Do you have any idea how the process of becoming a doctor works?
You graduate medical school, you then interview at a multitude of residency programs. You rank them. Meanwhile, the programs rank those med school graduates that interviewed with them.
Now, are there family doctors who got straight A's in med school? Sure.
But which ever fields are in the highest demand, those don't take C students.
Those who make the best grades go to the best residences.
You can almost guarantee that your family doctor, and the ER doctors you see got much lower grades than the heart surgeon.