Of course, a retention for defects is possible, and I would definitely enforce that, even more than 10%. Depending on how severe the defects are. The warranty does not have to be confirmed by him, it is regulated by law. Only: You will probably never be able to enforce a warranty claim against the craftsman. Furthermore, during the warranty period, the principle applies that YOU have to prove that the craftsman is responsible for the defects. Therefore, do not even start the warranty at all, under any circumstances! This means you may not accept the service, not even tacitly by putting it to use. To ensure this, you must notify him of the defects in writing and make it clear that you do not accept the service as is. Due to the defects, you withhold something between 10% and 50%, and that’s the letter.
By the way: The argument that the client basically "wanted the defects that way" rarely holds. The craftsman is legally obliged to work according to the recognized rules of technology. If you require him to carry out the work differently, he must formulate a reservation and inform you of the risks of the incorrect execution. This must be documented in writing.