Perceptionally, charging hourly is safer or you. But clients always think that you will pad the bills and take more time to do things than it should. It's in your best interest to take as much time as possible. That's just the way it is.
Now, fixed bids. There's a risk doing for a fixed price. What happens if it goes longer, and you spend more time than you planned? You take it in the shorts. But, the customer knows that you are going to do your damnedess to get it done on time and under budget.
But for comparison, look at public works construction companies. Those that build airports, highways, etc. All the companies give a fixed bid, and the lowest fixed bid wins. Adding a $5 billion wing to a major metro airport Like LAX or SFO is incredibly complex.
They key is to be super careful on your bid. And, like construction companies that do bids on complex projects, you have to be super vigelent about change orders. Meaning, the person you are working for wants changes to their original proposal. Because then it changes your bid. And, in construction and in programming, there are ALWAYS changes. So if they change their specifications in the slightest bit, you have to be 100% sure to charge them more. This is how construction companies actually make money. On the change orders. Here is what the ABA says about construction change orders: https://www.americanbar.org/groups/construction_industry/pub...
This is just general information for you. I am not a lawyer.
But, after you make a bid, and the person that you are doing the work for decides to make a change, that's on them, so they can't really accuse you of trying to "pad the charges."
Fixed bids are actually really great if you get super good at doing one thing, and get it done under the time you bid. If you work super fast and efficiently at an hourly rate, you won't get paid as much. For instance, if you do a bid to do create a software powered toenail clippers for $4,000, and you've done it before and can do it in 2 hours, you get paid $2,000 per hour. But if you do an hourly rate at $150 per hour, you only get a total of $300. So doing a fixed bid, as long as you actually know how much time it will take you, is the best of all possible worlds. The only thing to be 100% on point about is that any changes make a change to the fixed price, and you can either go hourly or fixed price on the changes, depending on the situation that you can do.
For sure you need to make progress payments as you go along, and make sure you charge a hefty amount before you even start. Whether it is 25% or 33%, whatever the situation demands, but you want to get some cash flow going right away. Cash is king. Money talks, bullshit walks. Never take someone’s word on it. Never take any job where you don’t get paid a portion up front. Before you walk in the door. And make sure you watch the definitive video on getting paid: https://www.youtube.com/watch?v=jVkLVRt6c1U