If you sell your time you should set up retainer agreements. That’s similar to what f/t employees do.
Better, charge based on business value. With my customers I ask them to list their pain points and issues and then assign priorities and value to those. We both know what the work is worth. Getting it done faster than expected usually means the work is more valuable.
We all use this model every day. When I eat a restaurant I pay for the meal, not the time. When I pay someone to mow my lawn I expect a flat price based on the work, not to pay by the hour.
If you and your customer working together can’t define the tasks, put them in order, and assign values to them then you’re not doing the necessary requirements gathering and analysis. That’s how so many freelancer engagements end up in failure, disappointment, anger, and legal mediation.
Tbh I'm torn here, since hourly rates are really good for preventing scope creep. Where as per-project flat rates aren't great because they practically invite in scope creep.
I do think that retainer models for independents may very well be the future and are a nice happy medium.
That said, your point about "if you and your customer working together can’t define the tasks, put them in order, and assign values to them then you’re not doing the necessary requirements gathering and analysis" is tough because often times your customer doesn't want to pay for that. Curious, how do you get around that?
Hourly billing doesn’t prevent scope creep in my experience. Hourly billing often comes with an estimate, and the two sides may understand that estimate in different ways. Hourly no fixed fee can go wrong because of scope creep from the customer or poor estimating and wrong turns by the developer, or both. The scale of the problem becomes evident at the end of the schedule because it accumulates little by little. Then both parties blame each other.
I don’t take on projects if the customer can’t or won’t do the necessary requirements gathering and planning in advance and pay for my time. A customer who won’t do that is almost certainly going to have bigger problems down the road. I haven’t actually run into this problem a lot in 15+ years of freelancing, maybe once or twice.