Of course, our market is far from rational, etc, etc.
FWIW, I don't think that software developers are overpaid, at all. It's a difficult career, requiring years of intense study to do well. Sure, maybe not as much as Doctors, at least not formally, but a lot of that has to do with the structure of medical education in the United States (in particular, the requirement to complete an undergrad degree prior to admission to medical school). The job of a surgeon is certainly more difficult than the average software developer, but compared to a SRE at Google, say, who is working with real, "living" distributed systems that interact in complex ways, I would say they are comparable. If anything, I'd expect, in a rational market, for the SRE to be paid more, because their services are providing for millions or billions of customers, while the surgeon is only providing for one at a time (and maybe a few thousand over their carrer).