For fixed-fee contracts, I usually include testing and bug-fixing in the quoted price, and make sure to include the time spent on that in the estimates. There has to be a sign-off time limit though (for example 1-2 months), during which the client is supposed to test the software to their satisfaction and after which newly discovered bugs are not included - otherwise a project can linger on forever in your schedule.
However with fixed-fee contracts the main difficulty is agreeing on what are bugs, and what are change requests if the initial plan was not detailed enough.
We have to use that response alot when someone asks about a program that doesn't work the way they expect it to. Did you explicitly say that it needs to do this in the contract? No? Then it's not a bug, it's an enhancement.
That being said, there will always be issues until we have AI that writes AI that writes code (with the humans out of the loop).