Earlier quoted context omitted.
Yeah my impression is that there are a decent number of people who are probably smart enough to learn to program, at least in an "easy" language like Python, but it's just too boring for the average person. I think law is similar. Do you really need to be super smart to be a lawyer? Probably not. But you do have to be vaguely interested in reading legal texts and... Jesus no thanks.
Most people are smart enough to program, I think. The biggest hurdle is being able to sit down and work on a program for 8 hours a day. All the other skills can be learned.
I suspect we're in a bubble. Consider the charts at the end of https://users.ssc.wisc.edu/~hauser/merit_01_081502_complete...., specifically the "Computer occs." results. I don't think most people are smart enough to become professional programmers if they have to compete with existing professional programmers for jobs. I do think that if you look around the average office which employs programmers, most of the people in non-technical roles could have become a professional programmer, but that's a biased sample.