It is very simple really. All citizens are equal before the law. If you break the law you should be sanctioned. Mental health should not give one any privileges when it comes to the law. It should just determine whether you will be dealt by the criminal justice system or mental institution.
If you have a mental illness and do something out of character it shouldn’t be treated the same way as if someone just chose to do something.
Sometimes institutions are needed, sometimes not. It’s an act of injustice to treat the unwell in the same way as the well.
Like I said, all should be equal before the law otherwise law is useless. If you break the law, institutions are needed. If you do not break the law, institutions are not needed.
Mental illness in many cases defines ones character or changes it. So “out of character” is bs. Like I said, if one cannot understand the law they break, they should obviously not be dealt by the criminal justice system. Instead, they should be dealt by the appropriate alternative institutions. In any case, the law breaking should be stopped.