One example is the "call of the void", the "what if I jumped?" when looking from tall heights.
However there are also many other violent or sexual thoughts that are suppressed and also difficult to talk about socially. What defines the "mentally ill" then is how prominent this voice is and how often it leaks into the "physical" world.
These actions are usually controlled by threat of imprisonment/violence by the state, social punishment by the community, or controlled by being channeled into specific arenas and fantasies.(games/porns/sports/war/etc...)
Behaviors that leak out of these boundaries are "eccentric" when they don't seem to do any harm and immoral when they disrupt the boundaries themselves (hacker) or the structures within the boundaries.
Sometimes the boundaries are too restrictive like a straightjacket. They increase the internal pressure requiring stronger boundaries that increase the internal pressure until the whole thing explodes.
Sometimes the structures themselves need to be updated and modernized. E.g. women showing their face in public or wearing a bikini shouldn't topple all of society.
The pace of technology disrupts boundaries. This incentivizes and leads to more adaptable and resilient structures. The white-hat school prankster crosses into black-hat destruction territory only when others "can't keep up".
The point is that maybe there isn't a specific mental "illness" like a bug or a virus that acts as an antagonistic external entity. It's just behavior relative to societal boundaries and outlets (which vary greatly across culture and time).
Even a very black/white "illness" like schizophrenia seemingly used to have an social role as shaman-oracle but w/o this outlet can only express itself as axe murderer