This line of thinking has always puzzled me. At some point one’s brain must be so compromised that we really can’t expect them to function as a human, but most people’s reaction to that is “excusing” their behavior.
If you’re willing to admit that they don’t really have self-agency at that point, don’t they become an object at that point? Like we would have no problem putting down a dog that bit a child, let alone a dog that blew up buildings. The only reason we’re so accepting of putting down the dog is its lack of human status.
In our courts, claiming insanity seems to give you a defense against crimes you’ve committed but also maintaining all the rights and privileges of personhood.