I wrapped up a $200k fixed-rate project a few months ago that ended up being around $450/hr when the final invoice was sent. You have to know exactly what they need, typically by having experience in that industry. In this particular example, I had worked as an FTE for their largest competitor with a nearly identical product suite for like 6 years. I knew more about what they needed than their newly hired VP of Engineering did because he was only about 6 months into the industry.
Sounds amazing! How do you avoid the "oh, one more minor thing that is absolutely needed or the entire project will be a failure" that happens 75 times at the end of every project?
Do you just waterfall the requirements and don't start working until every i is dotted and every t is crossed in the requirements?
For this one in particular, it was split into a dozen or so modules and each one was specced and priced individually. Like you suggested, work didn't start until a module was fully done w/ all the design and specifications, and we mostly were able to stay 3-4 modules ahead in terms of requirements gathering. Not super agile but if you're quoting a price for months and months of work where the deadline is literally "this specific Tuesday in May," Agile just doesn't work. This time was "free" but included in my 450/hr number.
There a couple legitimately important "new" things which came up. Some got added on as T&M to one invoice or another, some I just did because they were just a few hours of work and not really worth the back and forth.
I would be very, very hesitant to start on a large fixed-price project without knowing a lot about the industry already.
I totally agree that one has to know the circumstances very well to do fixed bid successfully. But one quibble on the Agile stuff:
Agile is not a match for the contract if the client values contract negotiation over customer collaboration, as that's the opposite of one of the Agile values. [1]
However, even with a fixed-price contract, one can use Agile approaches internally so that you finish pieces early and often, in an order prioritized by customer value. That way when the specific Tuesday in May arrives, you are most likely to have completed the pieces they most care about. And also have the flexibility to make tweaks if priorities change.