Yes. I read in SCC Digest of 2012 about a Shera Singh case where judgement is delivered by a Supreme Court bench.
If a person has siezure or some temporary memory loss or other mental conditions in which he may not be knowing what he may be doing, he may not be able to even recognize faces, yes, he can be excused, as per this judgement.
This discussion was about Sec 84 of IPC.
For more Authentic Details, please read the actual judgement. This seems to be new law for me..
This case reminded of movie Gajani of Aamir Khan.