That's...not at all how that works. If the court decides that she was unable to consent, it won't matter if he thought she could consent. She could've verbally communicated her desire to have sex with him, and it would still be rape under the law if the court decides she wasn't competent enough to understand the implications of what she was doing.
Being ignorant of the law, and believing something incorrect doesn't make you unfit to stand trial. He understood he was having sex with her, he understood that she was mentally impaired on some level, and he understood it was wrong, since he lied about it, but even if he didn't understand it was wrong, that would not make him insane. Plenty of people commit crimes and believe their act was justified or acceptable. It really doesn't matter.
Not guilty by reason of insanity implies he was not in control of his actions. We know he was in control of his actions.
To put this into perspective, this situation is very similar legally to an adult having sex with an underage teen. The prosecution will not even bring up their participation or consent because, legally speaking, they cannot consent no matter they said or did. Plenty of those creeps would say "but but she didn't fight me!".
If the other party cannot consent legally, your belief that they consented will not be taken into account at all.