That depends on the situation.
Just because one is schizophrenic doesnt necessarily mean he doesn't know right from wrong, and most schizophrenic I met were kind hearted, feral cats-feeding with their last dim kinda people.
However, decades ago, I heard on the radio a fifteen year old girl who gave birth murdered her baby, and the judge let her go because she 'didnt know what she was doing.' She asked to be alone with the baby in the hospital because she knew she couldnt do it in front of the nurses. She knew to hide the knife, knew to hide the body, knew to act normal and not let her intentions know when she asked to be alone with him.
And I read in the news about a woman who threw her baby and the poodle out the fourth floor window when her husband wasnt home, and then ran outside naked. She knew to do this when her husband wasnt home, and then she didnt jump out the window herself. She knew how to make a good show by running around naked in a place where people could see her, not the alley so she won't get hurt, and then she can pretend later to be crazy and avoid punishment.
When people plan a murder like this, they're either not mentally ill and just pretending to avoid punishment, or they're mentally ill and also happen to be as evil as some people who aren't mentally ill, and know they can use their mental illness as a method to avoid punishment. So sorry, your honor, I didn't know what I was doing.
Some people really don't know what they're doing and shouldn't be punished, but then they would do it in front of everyone, including the police. And they'll act like they don't know what they're doing, like my neighbor who started burning the bible on his oven and throwing burning pieces of paper in the wastbasket, and saying he'll survive, and not wearing a coat when almost being thrown out in mid January in Chicago cold. He really acted like he didn't know what he was doing. That's different.