Treatment of mental health patients through justice system a 'failure'