I’ve worked with several CEOs and countless senior executives, both at very large companies and small, who had varying degrees of competency. I don’t think this is generally true. Being successful at that job entails a specialized skill set that is rarely evident in middle management. What you are “managing” at the most senior levels of large organizations is very different than as a middle manager, it becomes an entirely different kind of role. The vast majority of people aren’t even able to competently run a small company or startup, never mind a large enterprise.
I think very few people are really cut out for that role. It is a case where demand exceeds supply, which drives up prices. There are many mediocre people in those roles because supply is so scarce.