Now that you have shipped the technically correct but not very useful thing, you collect the fee and then start accepting "change orders" at a punitive rate. At this point switching to another contractor will be even more risky and expensive, so they'll probably just suck it up. Or if you're really good at the game, you then negotiate a whole new fixed-fee contract with a higher price tag, and the deliver what they now think they want.
Bonus points if, as I've seen a big-name global contractor do, you deliver something not even barely working but possibly conforming to specs, and then just walk off the job. Even though the client has contractual obligations that they can't fulfill if the software doesn't work. At that point, the client realizes that a) they still need the software, b) the big-name contractor is the only who can deliver in time, and c) suing is risky, will take years, and anyway the big-name contractor can afford more lawyers. In this case the client signed another multi-million dollar contract with the big-name contractor, easily doubling the "fixed" fee. I lost touch with my contacts there before the thing ever worked, so I don't know how many times the big-name global contractor pulled this off on the same job.