This is not the best approach, honestly.
No one would pay me the effective hourly rates that I make off fixed rate projects, and everyone is happy. Clients almost always prefer to know what they’re going to pay upfront.
Additionally, hourly seems simpler and low risk, but it’s all downside for you. If you’re way more efficient, you get penalized. But if it takes longer than your estimate, clients get pissed. At extremes, they may just refuse to pay. Tell a client your estimate is $10k and then try to bill $30k, tell me what happens :)
Just like value-based pricing, flat rate takes a bit more skill to learn, but it’s dramatically more profitable in the long run.
In some industries, you cannot avoid flat pricing. E.g. bidding on any sort of construction or renovation project. You may have workers under you who work by the hour, but that's your problem.
If a critical security patch requires a change in the code, your client is going to have to either change it themselves or get you on the job pronto... and do you really want to set the expectation that you will be available pronto, forever?
I think the days of write the code, launch, then ride off into the sunset are over. Code should be considered temporary and perishable, and IMO consultants should acknowledge that upfront and help their clients plan for it.
Almost never take a fixed bid contract. They're pretty much always a net negative.
Give clients discounts for paying early. Everyone loves a discount. Never discount your hourly rate though, because once you do that once for a client they'll never stop arguing with you about it. There's a line on Schedule C for recording discounts.
If you turn over raw source code to a client, stress (in written, contractual form) that if any other contractor/employee changes the code, then you will charge them a premium rate for any changes or fixes.