I think the same can be said for a lot of fields. E.g., just because someone’s an excellent architect doesn’t make them a good animator by default.
There’s also so many variations on the types of programming. Maybe a mathematician might be better suited for data science rather than frontend stuff. And even then, each person is different and has their own set of skills part from whatever their formal training is.
What I think makes good programmers is having the ability to bash your head against your desk while debugging, but still walking away at the end of the day loving the job and problem solving. Persistence and creativity go a long way in programming.