Also, doctors have to deal with the byzantine paperwork nonsense in the health field, and work with the general public as well as in places that have infectious diseases floating around. And can't work from home as easily. I wouldn't trade not having to work with the general public for a couple hundred thousand.
I was a somewhat successful premed student (99.9th percentile MCAT, CS major), and I went the FAANG route instead. Physician and tech salaries are similar in that the top makes alot more than everyone else, although the bottom for physicians is a bit higher. For less competitive people who may only have only gotten into a single med school and whose job prospects with a biology degree are limited, the med route can make sense from a purely financial point of view.
The doctor making 200k stitching up chainsaw mishaps in some small city can live on several acres (or in the nicest suburb of that city if that's his preference), send his kids to private school, he drinks $2 milk and fills his car up with $2 gas. Try living like that in SF or any other "tech hub" on 200k.
I'm not saying tech isn't easier and doesn't start off making big bucks faster but doctor probably takes the lead around age 30 or so. If you wanna make big bucks without going into management doctor seems like the better route.