"it varies"
Often local actors have a degree of freedom in how they interpret and put into action, the laws. For example, a local judge who handles commitments may have personal issues that make him more, or less, willing to commit a patient against his will.
One may be fooled by 'outpatient commitment' laws more and more states have - in fact, if you research the numbers, the outpatient commitment laws have resulted in the actual treatment, of a surprisingly small number of people, even in the course of a decade or more. Most of them have extremely complex requirements that many people are highly unlikely to meet (for example, many OC programs only take people who have a history of compliance with taking medication).
In the urban areas, there tends to be a great overload of facilities and a very, very high bar that needs to be reached for people to be kept in a psychiatric hospital against their will. Sometimes the problem is not as acute in rural areas due to less overload of facilities. But that's not always the case - in my rural area we joke that that are three beds total for committments. And it's not that small a county.
"a diagnosis is never an excuse"
Ah...depends. Depends on what you mean by that.
People are responsible for their own behavior in the eyes of the law, but the fact is, some are a lot sicker than others.
I've got one friend with schizophrenia, 100% treatment compliant, who runs a teaching program at a hospital and lectures on schizophrenia and mental health all over the world. And when he's having a relapse, he STILL has to go into the hospital and does not have 100% control over what he does. Like a heart patient or a person who has MS, when he has a bad spell, he needs to be in the hospital.
And I've got another friend who can't do anything except go from his bedroom to the day room in a residential facility, also 100% treatment compliant, when he relapses, he stops being able to feed himself with a spoon.
Sure the majority of people are mildly or moderately ill, spend most of their time OUT of a hospital, don't need a permanent residential care situation, and do very, very well if they get diagnosed and start treatment soon, if they stick with treatment and don't drink or do street drugs. And even many of THESE people struggle very hard to learn to control their behavior. When your senses lie to you it's awfully hard to learn to ignore them. It takes time, effort, repetition...and a good many of these folks don't 'learn from experience' on the same schedule as other people.
frankly, I'm never 100% surprised when a person who has a given diagnosis, behaves in lots of ways expected for that diagnosis.
Again, what a mentally ill person is capable of, what can be expected of them, what they should be held accountable for doing, how they are made to understand consequences, IF they can understand and respond with those consequences in mind.....that depends.
There are times when they can help it, can just sort of say, 'No, I'm not going to lose it' and there are times and people who just can't. It depends on what they've got, and how bad it is, and who it is.
Sure most people can control their behavior. And some cannot. There are some violent autistic adults you can reach and talk to and give them a structure they understand and thrive under - and there are some violent autistic adults you can't succeed in controlling violence that way.
I worked with such a kid - there just was no punishment, contingency or structure that did any good. And the way his mother was treated was horrific. It was all her fault, she wasn't tough enough, etc, etc, etc. Well the fact was this kid was different. The degree of unchanging routine this kid needed in order not to start harming himself...the only place that was even MOSTLY in place was in a permanent residential facility. Even there he got agitated at times. Medication helped, but not 100%. Not everyone responds to everything. Depends on the illness, how severe it is in that individual, how much it affects their brain.
Some people are so severely ill, that no treatment in the world would make them appear 100% like chronically normal people.
Sometimes treatment is so delayed or so sporadic, or simple the wrong treatment. Then the results aren't the greatest. Some people are mentally ill and do drugs or alcohol, damaging their brain even more.