Mentally ill people cannot help their actions or often even realize them.
True in some cases at certain junctures when symptoms are at their worst.
As a behavioral health clinician, I had a patient confess murder and another violent crime to me. I asked him why he didn't kill the 2nd victim and he said he stopped because he knew it was wrong. This was a person who was very obviously mentally ill by anyone's observation--always acting and dressing bizarre. I talked to him about turning himself in to the police. He agreed he should be locked up and acknowledged his acts were wrong.
That is my most "not cognizant" example of a patient-criminal. My others had a greater awareness of their wrongs and ability to stop them.
There is a saying in AA that is good. "You are not responsible for your disease, but you are responsible for your recovery."
True, the difficulty with mental illness is getting the person to be aware of the problem and accept help. This is true of most humans who need to change something big about themselves--we don't like change or admitting something's wrong.
This guy reportedly had persecutory delusions and command hallucinations, indicative of the most serious level of illness. He refused help--not unusual. It's unfortunate no one forced him to get help before he became violent.