When you’ve already been analyzed and (as with the Batman shooter) come out to your analyst that you want to kill, you’ve given up that bit of freedom.
HYPOTHETICALLY, call the police and tell them that you are going to kill people then see if they just wait until AFTER you’ve done it.
Of course you can be arrested for making threats, but that isn’t what I’m talking about. The original poster wanted to detect and restrict people like Lanza, but most of those people are not making threats... so there is no grounds to lock them up until they commit a crime.