Here in Texas we have at least one person in prison who would be on death row if considered sane. The patient rights laws cannot compel this person to take psych meds against his will. So he cannot be released and he cannot be executed.
And as for most mental illness, it cannot be cured. It can be treated or be inactive, but it never goes away. So if you choose to commit those with mental illness until cured, it is basically a life sentence.
Schizophrenic people rarely act differently in different situations. The might be able to control certain aspects of their disease but they aren't one person on Sunday and a different person every other day of the week.
http://www.nimh.nih.gov/health/publ.../what-are-the-symptoms-of-schizophrenia.shtml
Other mental disorders can cause delusions or hallucinations. Bi-polar people when hypomanic are often delusional, and paranoid, with extremely high energy levels.