Absolutely you can name incredibly talented people who suffered from a mental illness, but that does not counter my assertion. Instead it's an instance of Berkson's paradox [1] wherein you are unlikely to consider the group of people who failed high school, have a drug addiction, are homeless, or are otherwise suffering from their OCD. The only people with OCD who have a name worth mentioning will be among the most successful people in their field.
But that doesn't change the studies that show that unlike the myth first popularized by Pierre Janet and then popularized by Freud about the positive relationship between obsessiveness and intelligence, it turns out the correlation is negative [2]. Having OCD is overall detrimental to ones ability to perform intellectual tasks and statistically people with OCD are more likely to end up homeless or in poverty, the victim of abuse or otherwise taken advantage of.
Does this mean that a mental illness is a death sentence? No and I never claimed it was. My position is that historically if you did suffer from a mental illness, you were also more likely to be anti-social or introverted, and hence dissuaded from pursuing fields that involved working with other people. As such it's tempting to look back at many of the historical icons in said fields, see that many of them did suffer from a mental illness and conclude that said mental illness must have been a benefit to them. Absolutely not, it's just that people without a mental illness who were sociable likely did not study math or physics as they would have been encouraged both financially and socially to pursue other fields.
Going forward, as more fields that were traditionally studied by individuals become more team oriented, I hypothesize that we will no longer associate future leaders in math, physics, computer science, etc... with their mental illness. Of course we will still see some talented people who do suffer from mental illness, but the mystique that is often written about it, as if these people peered into a world only accessible to them because of their madness and saw things only they could possibly understand, will be considered farcical and instead we will appreciate that these people succeeded in spite of their mental illness rather than because of it.
[1] https://en.wikipedia.org/wiki/Berkson%27s_paradox
[2] https://pubmed.ncbi.nlm.nih.gov/28864868/