I think this comparison misses the impact of Baumol's cost disease in the US. I mean, your link says a primary care physician earns $161k in the US. That's after going into a ton of debt with 4 years of medical school, and then making slave wages and horrendous hours as a resident for 4-5 years.
Meanwhile, it's pretty easy for a software engineer in the US to make that much not long after graduating college (I don't want to over reference something like FAANG salaries, which relatively few engineers make, but still, it's totally reasonable for a software dev to make that much somewhere between 0-10 years after graduation). That's after going into much less debt, and software jobs are way, way, way easier than medical jobs - honestly I think anyone who says otherwise is just full of shit (I'm a software eng for what it's worth).
So most people who can go on to be doctors have at least a similar level of intelligence/work ethic etc. as software devs (or lots of other careers in business, etc.) There is no way doctors are ever going to get paid significantly less than similarly credentialed professionals in the US.