Main trick to mitigating feature crap I have used is by first I add extra padding to cost.
Second i tell my clients that I provide free maintenance for 2 weeks after the project si delivered. Mostly this helps because clients want speed over reliability. So we push and the next two weeks is bug fixing - sometimes it's three.
However no matter what happens I would never build a new feature in the maintenance period
For bigger things, it's important that expectations are set upfront and are clear to everyone. That way, if someone wants a new feature, they can have it for a price.
First, it pushes that conversation to the beginning and can make it negotiable. Then it reduces surprises throughout. And finally, it gives you the ability to say "No, we agreed to.." when you need.
Nothing is perfect but it mitigates some risk.
BATNA is everything.