Bingo. Also, there is a nontrivial chance of going to med school but
not getting into a residency program. And, residency is typically 4 years, not 3. In the case of my partner, she did undergrad (4) + post-bacc (2) + med school (4) + residency (4) + optional fellowship (3). So call it 12-17 years of training. Then, and only then, do you make a "starting doctor salary". But now you have hundreds of thousands in debt, interest payments, malpractice insurance, and, in some specialties, still insane hours.
If you're a doctor who is "doing it for the money", you have simply not understood the concept of opportunity cost. :)