For neurodivergent people/people with mental illnesses, is it haram for them to wish for death even when they can’t help it?
This includes people with mental illnesses like depression, anxiety, and other personality disorders. Not necessarily those who are considered "insane"

In general, wishing death upon oneself could have a positive or a negative motive.
A positive motive would be wanting to be closer to God, and recognizing this world, as not being worthy except for preparing for the meeting with the Lord. An example of this type is what god in the holy Quran tells those who claim to be close to God to wish for death.
The negative one which is forbidden is when one is complaining about their circumstances in other words, not pleased with God’s decree