and you're basically saying that I (as the client) have to accept your solution as final even if it's your fault that the solution is worthless. How many clients do you think would pay if you tried to pull that?
If the solution fits the requirements as laid out in the requirements document the customer signed off on as part of their contract, then yes he has to pay for it.
I'd (if I found out that the actual technical needs are different from what the customer stated) notify the customer that the requirements (and thus the contract) had better be ammended (possibly introducing extra cost for the customer, depending on the extra effort or investment needed on our part) or the software wouldn't meet his needs (rather than his stated requirements), but I would need to have some idea of the actual use he was going to make of the stuff beforehand.