People who have been proven to be dangerous to self or society are disarmed for the protection of self or society. At least, that's the theory. When a judge says "don't do this", unless the person is caught doing whatever there's no way to enforce that whim.
And no, your guess about people with brain disorders isn't true. Read the 4473, read the explanation of the questions that comes with the form. If someone has been found not guilty of a crime due to mental disease or defect, or if they've been adjudicated mentally incompetent, they're prohibited from legally possesing a firearm. Doesn't mean they won't, just means they can't do it legally... if that info is available to the people doing the background check if they try to buy from a dealer.
But for your garden-variety citizens with brain diseases there's no prohibition, at least in federal law. This is one more area where we need nationwide standardization. Some states require people to waive their right to privacy in order to be allowed the privilege of self-defense. If you don't let the gov't snoop in your medical records, you can't have a firearm. That's wrong. Heck, if we're going to restrict self-defense tools based on medical problems, I'd want to ban people with epilepsy. They can't control their body, so can't control a gun, & that's unsafe. [It's an example. I don't really think that.]
And as others have pointed out, in some states it's legal to be in possession & have varying amounts of alcohol in ones body. Again, we need nationwide standardization.