A newly released felon can not own a gun, and if they are found possessing one it can be taken away. Some states allow a felon, after a certain amount of time and good character to have their rights returned.
If you can do that for a felon why cant you do it for someone with a violent form of mental illness
Criminals don't care about the law. You're thinking like an honest person and good on you for being an honest person.
Think of it like this. We can treat a cold with vitamin C and some decongestants but the goal is to not get the cold in the first place by eating right, washing hands, etc. etc.
The goal here is to identify potential crazies but we can't just let the neighbor or an estranged spouse do it without serious checks and balances. Again; frequently these crazies identify themselves ahead of time through contact with law enforcement or mental health facilities so let's find a way to track that info and then red flag them for testing. All records must be kept confidential with serious mandatory prison time for those who blab/leak it. Most will probably be a false positive but it may be a way to help the real crazies or stop them BEFORE they go ballistic.
I understand where you're coming from but there are no easy answers; especially the current red flag laws in some states. Those might as well be called anti-freedom laws or No Bill of Rights laws. They are wrong-headed knee jerk reactions that will do more harm than good.
What I know for sure though is disarming honest normal law-abiding citizens is the most wrong thing our society can do. Identifying the crazies is just the first step. Now what? Do we incarcerate them in mental health facilities for life knowing they can get guns, bomb making equipment, biological agents and poisons, then commit mayhem if released or do we attempt to figure out the problem and hopefully reintroduce them back into society risking the treatment won't work. Tough questions with no clear answers.

If you can do that for a felon why cant you do it for someone with a violent form of mental illness
who gets to say what is a violent form of mental illness?