So if you join a company with terrible infrastructure that needs a ton of work, you don't get paid until it's operational? What if there are organizational issues within the company that prevent you from actually resolving things long-term? Rarely is a single engineer empowered to make a difference in the up-time.
Physicians face similar challenges when it comes to the bureaucracy in the world of medicine, but with the added challenge of working on the unpredictable biology of human beings rather than a bunch of transistors that are predictable in their behavior.
And imagine if the system was setup in the way you suggest, which doctor in their right mind would take on patients where the treatments aren't as clear cut? Who wants to work for months or years with no guarantee of pay?
Honestly, comparing the two fields is pointless. I do not envy physicians. They are working within a broken system and most are doing the best they can. Blaming them will get us nowhere.
There is a movement commonly referred to as "Outcomes-based Healthcare" that is rethinking the way the system approaches treatment. The focus isn't necessarily on compensating physicians for their outcomes, but changing the metrics that are used to evaluate potential treatment options. [https://www.healthcatalyst.com/Outcomes-Based-Healthcare-Top...]
I've been following ZDoggMD for a couple years now and I really like listening to his perspective on the world of healthcare. Check him out if you have any interest: https://www.youtube.com/watch?v=9hEnAmfTBZs
Shouldn't I get payed for the work my software does, without interruption, day after day after day?