That's a good one. If it's a refinance, that's easy, just rescind, but if you are thinking about walking away from a purchase it raises all sorts of issues.
There are several parties to every transaction besides the seller and the buyer. All parties have a duty one to another to act in good faith. I would hope that a buyer would be a good consumer and get quotes from all settlement service providers up front. Remember, you don't go shopping at the closing table. You make all of your selections up front. If you skip the shopping obligations, don't expect sympathy from anyone at the closing table. Even if you have shopped and gotten quotes, there are always unforeseen circumstances. Be patient and listen to the explanations. You may find that there is a valid reason for an additional charge.
So, if you are acting in good faith and not just trying to weasel out of costs you had already agreed to absorb, and a provider is not living up to their agreement, you can threaten to walk away.
Making the threat will often push the bad actor into making good, especially when all other parties in the transaction are looking at them and wondering if they are nuts.
If no one agrees to change the figures and you want to walk away, I would advise taking a break and getting legal advice from your own attorney, not the attorney working for the title company or real estate agency or the seller or the lender. Walking away from a closing is potentially defaulting on a contract and you may have legal obligations.