I don't know if atheism and pessimism are linked in any ways. I'm an atheist, yet I'm an unbroken optimist. But maybe it exists. The sample size we need to look at should be large enough before we reach a conclusion.
And the coincidence might be only because science is relatively new, and was frowned upon at a time earlier. Belief in God has been ubiquitous since forever, so if the greatest men believed in God, weak men did too. Everyone did. So I would say that it' not even a coincidence.
But yes, I do believe that a belief in God might help greatness though powers of hope, positivity, greater resilience, etc. But that is a proof that a belief in God is helpful, not that God exists. The distinction is important to know.