Is the insanity defence a loophole for terrorists in Canada, the UK and USA?

Is the insanity defence a loophole for terrorists in Canada, the UK and USA?

Can the Insanity defence be misused by terrorists? -For my research, I’ll focus on the insanity defence law and terrorism-related court cases in Canada, the UK and USA (if not enough examples were found in these counties, then talk about Europe too). I’ll investigate whether the “insanity defence” is too broad and can act as the loophole for terrorists to bypass jail time. Moreover, if it does turn out to be a major loophole that can be used by any criminal unjustly, then I want to discuss how can this loophole be clogged. I want a detailed explanation of the insanity defence with examples and its history. Moreover, define terrorism and if it is a mental illness. My title should be: The Thin Line Between Terrorism & Mental Illnesses