It's not illegal to be crazy, and it shouldn't be overstigmatized. But there needs to be a happy medium.
I don't think that it's really a happy medium. Destigmatisation is the best and frankly only way to effective help both those with mental illness and prevent this kind of tragedy. Without actively combatting mental health stigmas law enforcement efforts to cover these cracks are futile at best, counter-productive at worst.
It's simply more important to encourage and enable people to get help for mental illnesses than it is to track them, especially if the latter discourages the former. Treatment and support are far more effective at avoiding violence. Especially given that violence is far more likely to be directed
towards those with mental illness than they are to be violent towards others.
Prioritising putting restrictions on those with mental illness is simply encouraging them to hide their symptoms and avoid seeking help. In the few cases where the illness does cause potential danger that increased external threat (false perception as it may be) only makes matters worse.
Preventing people with serious mental illness from obtaining guns is not a bad idea, but drawing some sort of formal legal line about who can and can't have weapons is problematic at best, even before you get into the difficulties with enforcement.
I'd actually put a highest priority on people with depression or bipolar disorder having easy access to guns given the extremely rates of suicide attempts. But even then trying to define when they can have access to guns (or knifes, or pills, etc) legally is impossible and any attempts at enforcing such a ban would be grotesquely damaging and impractical. You need people who can care for them, notice symptoms and have their permission and trust to keep them safe.