In terms of raw intellectual horsepower, Musk is (or definitely *was*) clearly above average.
The problem is that extended sycophancy, rampant drug abuse and sleep deprivation will make anyone stupid, which is exactly what happened. Like replacing motor oil with chocolate milk in a racing engine.