Yes, but first we need to define our terms. Perhaps mentally ill is a poor expression. Mentally abnormal seems more correct, though that seems to have even more negative connotations. Though in my nomenclature abnormal could be anything other than average. Therefore genius would be considered an abnormality.
I toyed with the idea of using the phrase mental nonconformity but that sounds like a choice so it’s not appropriate. Mental abnormality it is.
I should mention here that, if they were asked, nearly every writer I know would give you a laundry list of their abnormalities. My own would include; social anxiety, depression, over-thinking, insomnia, self-doubt and poor self-image.
So are there sane writers? No, but using my criteria, it would be hard to find any human who doesn’t have mental abnormalities. It’s just that writers are mentally abnormal out loud. Their problems are documented on an ongoing basis. Then they actively try to have other people participate in their anxieties.
This is the problem when you over-think everything. You talk yourself in circles till all semblance of an answer is rendered useless. So I’ll just say this; You have to be crazy to be a writer.