Straight answer
A board revision costs weeks. A code revision costs an afternoon.
Hardware takes longer and costs more than software because a board change means a minimum order and another round of bring-up. The first question is whether the job can be done on hardware that already exists: an off-the-shelf flight controller, a commercial sensor, someone else's radio. Often it can, and I will say so.
A custom board earns its keep when the part you need does not exist, cannot be sourced under the rules you have to follow, costs too much at your quantity, or will not survive where you are putting it. I have hit all four. They are rarer than the first sketch suggests.