There’s really not so much in medicine you can teach yourself outside of the second half of medical school and residency. That is the real training — on the job.
Sure you can get a head start on some preclinical subjects or may study them as part of an undergrad, but that isn’t the “hard” part.
You simply can’t teach yourself to be a doctor, since the job is so intimately tied to a complex setting you must participate in, and there’s no Linux kernel or GitHub equivalent.
In the U.S. getting that license requires med school. Almost no one is capable of learning advanced topics on their own unless they have already been trained to learn an advanced topic. It’s interesting to see the number of comments talking as if self learning is easy or doable for any but a small percent of the population.
Self learning a topic is largely an ability of those who have been taught advanced knowledge in some area.
Also the young with relatively less to do. When I was little, I started reading calculus books in about 4th grade; I couldn't understand them much but with a few years of trying I finally mostly got it at a conceptual level (tho I didn't do the homeworks till I took it in school; but by then it seemed to be the easiest subject of all). I also read this cool book "Metamathematics" by Kleene and then wrote (in MS Basic for the Ohio Scientific C1P, using computed gosubs) a recursive descent parser for numerical math equations, so I could type in like "i ^ (1/i)" (I only had +,-,x,/ and ^ but they all took all complex numbers; I might have had ln as well? I could only implement functions where I could figure out how to evaluate them, which excluded cos and sin unless I used exp(theta i pi) = cos(theta pi) + i sin (theta pi) and see what it was as a complex number. It wasn't ground breaking, but it was self-taught (and I could rewrite that program to this day pretty quickly).
But as a grown-up, it's more efficient to get help learning hard things. And some things are harder than others. I think you can learn calculus on your own, and certainly computability theory, and point set topology, but learning finite-group theory, which has a lot of numeric details, or measure theory at a really solid level, would be getting harder. Still doable if you have the inner drive, but lot more efficient to take grad level classes where you turn in homework. Also doing a lot of homework does give you a sort of muscle memory "a function is continuous iff the inverse image of open sets are open".
I wouldn't tell everyone to become a professor, but I'd certainly recommend US grad level classes as an extremely efficient way to learn a lot.
However, I would love to have a doctor who was so passionate about it they taught themselves before going to school.