Louis de Branges claimed for years to have a proof of Riemann Hypothesis. No one really agreed with his conclusion. He is certainly a first rate mathematician and had he came up with a proof that others accepted he’d be lauded as a great mathematician.
Abhyankar claimed that no one has ever really understood Hironaka’s resolution of singularities paper. Hironaka is a Field’s Medalist and Abhyankar a great mathematician in his own right. He was never able to find a simpler proof for resolution of singularities. If he had gotten lucky then he would have.
The point is, that luck plays a role in terms of whether or not the right idea pops into your head. How many brilliant people labored over problems that simply have no solution and thus aren’t considered one of the greats? Newton wrote more about alchemy than math or physics. He’s not considered a great chemist. One thing the greats have in common is spending a great deal of time thinking about problems. That increases the probability of coming up with a brilliant insight.
Of course, it is not all luck. You do have to have good intuition. Here’s a quote by Chaitin:
Gödel's incompleteness theorem tells us that within mathematics there are statements that are unknowable, or undecidable. Omega tells us that there are in fact infinitely many such statements: whether any one of the infinitely many bits of Omega is a 0 or a 1 is something we cannot deduce from any mathematical theory. More precisely, any maths theory enables us to determine at most finitely many bits of Omega.
In some sense we get a survivorship bias when talking about the greats. They happened to work on a problem that was solvable. I suggest there are many more equally brilliant people who didn’t get lucky and thus are unknown.