I agree, two famous mathematicians who had severe mental illnesses come to mind, Kurt Gödel and John Nash. In fact there seems to be a link between the two (intelligence and predisposition to mental illnesses), see: https://www.psychologytoday.com/us/articles/201707/the-mad-g...
>In fact there seems to be a link between the two (intelligence and predisposition to mental illnesses)
I don't think it's real. I attribute it to a selection effect.
Of all the people with mental illnesses it's necessarily the particularly smart or talented ones that you hear about.
The more of a handicap something is, the more extreme other abilities have to be to cancel out and produce a notable accomplishment or even an average, comfortable life.
People who aren't brilliant in some way, aren't going to be noticed, and have little to gain by sharing their experiences.
I used to volunteer for a mental health advocacy non-profit, and they had a poster listing all the famous people that supposedly had some sort of mental illness. I didn't find it inspirational, because I suspected on the one hand it was kind of reaching for many of them, and on the other, it had the unintentional implication to me, that if you aren't Einstein you can only pretend to be, or be nothing.
Society fixates on geniuses with mental illness for another reason - they are likely to be able to describe their inner life much better than the average person. But they might not be representative.