I believe mentally ill people created it in the beginning of time somewhere or even before the beginning of time physiologically speaking as an expression of their own distorted perception originating from deeply problematic issues within their own psychology/psyche that they chose not to solve and instead chose to expand through various mental illnesses and expressions of mental dysfunction that we see in the world today.
Y
My own experience is somewhat different with some similarities to your theory. I don’t know about it being created before the beginning of time as an expression of their own distorted perceptions, but I do see it as karma, which is the similarity. I don’t think it was caused because of a distorted perception, which implies mentally ill people are basically malfunctioning, but I believe, like in my own experience, events/situations and behaviour from people occurs which traumatises and causes stress to the person, causing mental illness. It is created through past karma that originated from a behaviour which must be repented. In short, it’s a punishment. Not all mental illness will be a punishment but they will all serve the same purpose, as all our experiences do, which is to learn and grow spiritually.
U