Your GP isn’t a genius, and they’re more often than not just reading the solution from webmd the same way you might look it up on stackoverflow.
I know this because my GP flat out told me this is the case.
It’s certainly a job that requires a lot of skill, knowledge and experience so as not to do harm, but that’s true of software engineering too.
Some exposure to some kind of programming is probably a good thing, but I think this it is very unlikely for the average person to learn to code without either thousands of years of evolution, genetic engineering of humanity, or changing the definition of coding.
The average person cannot build a consistent mental model of complex abstract concepts. Schools have done lots of tests to prospective CS students trying to see how they'd be as programmers. The point isn't to see if they got the right answer, the point was to see if they could merely come up with a consistent mental model of what abstract symbols mean, and many people can't do that.