Why did Umar ibn Al-Khattaab sentence a lunatic woman to death even though he knew that an insane person is not to be punished for his or her crime?
Narrated Ali ibn AbuTalib:
Ibn Abbas said: A lunatic woman who had committed adultery was brought to Umar. He consulted the people and ordered that she should be stoned.
Ali ibn Abu Talib passed by and said: What is the matter with this (woman)? They said: This is a lunatic woman belonging to a certain family. She has committed adultery. Umar has given orders that she should be stoned.
He said: Take her back. He then came to him and said: Commander of the Faithful, do you not know that there are three people whose actions are not recorded: a lunatic till he is restored to reason, a sleeper till he awakes, and a boy till he reaches puberty?
He said: Yes. He then asked: Why is it that this woman is being stoned?
He said: There is nothing. He then said: Let her go. He (Umar) let her go and began to utter: Allah is most great. (Sunan Abi Dawud 4399)
It should be noted here that Umar ibn Al-Khattaab (Radhi'allahu'anhu) was even criticized by Hazrat Ali ibn abi Talib (Radhi'allahu'anhu) for sentencing that lunatic woman to death. Umar (Radhi'allahu'anhu) even knew that an insane person should not be given capital punishment since such a person is not responsible for his or her actions.
Can someone explain?