Or Tim Sweeney of Epic Games, who made the early shareware ZZT and Jazz Jackrabbit, then went on to create Unreal, the game and engine: https://en.wikipedia.org/wiki/Tim_Sweeney_(game_developer) (hey, cool footnote... I was pretty pissed off when they changed their game Fortnite from an early cooperative PvE version to the PvP Battle Royale, emailed him and complained, and he personally replied with a thoughtful letter and then gave me a full refund... thank you, dude).
(And yes, of course Carmack, but someone mentioned him already)
That same example could be used for most of technology. I am sure Musk understands ML at a pretty solid level, but ask him to build or train a model and my guess is he wouldn't show "competence".
I think technical competence is also different then "could do it", e.g. I think Musk, Zuck could sit down and figure out most software related tasks. But it isn't a good use of their time. They have a good enough understanding of the technical limitations and requirements to lead people in product creation which has proven immensely valuable.
A bit of a casual comment. Current Twitter CEO was the CTO before. Satya nadella and sundar pihai both were fairly technical when they started. Even Zuckerberg won't fit your definition because he coded facebook initially in PHP/Mysql but what it is today is probably s lot more technically complex.
And anyway, the job of a CEO of a large public company is not to be technically competent. They just need to understand technology.
Another famous YC company is Cruise, who had Kyle Vogt as CEO, who was very hands on as a programmer in various roles before that and talks about specific tech being worked on for autonomous driving.
How about founders?
Knowing how to work the computers is not the only valuable or difficult skill. Managing a large company is not something a software engineer could do.