You know what's not a terminal illness that is bad enough that many with it would welcome death? Schizophrenia. For some the medicine works, the side effects are acceptable, they can lead a normal life. But there are plenty who can't. You know what else isn't a terminal illness that would make you long for oblivion? Surviving when the rest of your family didn't, surviving when the accident was your fault.
And you know what, if you think your life isn't worth living and you want out, you are suffering.
I've been depressed, I've been very depressed indeed and I'm glad to have seen the back of it but there are plenty who spend years and decades there and if they want out they should be let go, not locked up "for their own safety"