Why not both? A fixed project rate and all the extra that inevitably and uninvited show up cost by the hour. The reasoning being that 90~95% of the project are easy to complete with the rest often taking up an unknown amount of time and resources
If you know today that 5% of your projects have an “infinite downside” (i.e. an “unknown amount of time and resources”) you need to fix your contract to cap that to a reasonable amount.