???
Ignorantia juris non excusat
(Latin for "ignorance of the law does not excuse" or "ignorance of the law excuses no one") is a legal principle holding that a person who is unaware of a law may not escape liability for violating that law merely because he or she was unaware of its content. ...- wiki
Yeah, I’ve known the saying/principle for 64 years. But if you have no intent to commit a crime, you should not be charged. And, as I said, the principle you enunciate is definitely not applicable in insanity pleas.