I have to wonder how something like this happens. Does a family member (or an enemy?) simply show up with a lawyer and request a commitment hearing? What kind of "proof" could they present to convince any court to commit someone, without the court even considering hearing the other side of the case?
According to the opinion, both gentlemen in question had suicidal tendencies. Under state law, a law enforcement officer or medical professional can request an emergency hospitalization for up to three days. A medical professional has to certify he or she has examined the patient and that they are in need of mental treatment/evaluation and appear to be a danger to themselves or others. A judge simply insures this process takes place and there is no hearing for the evaluation period. An adversarial process is then employed if the health professionals believe further treatment is needed and the patient is a danger to himself or others.
Think of the situation where police are called to an intersection and a guy is waving a steak knife around threatening to cut his own throat. The guy would generally be hospitalized on an emergency basis. He might then agree to voluntary treatment for a longer period or be involuntarily committed after an adversarial hearing. It is this involuntary commitment that, according to this opinion, terminates the patient's right to own firearms.
The situation that hermannr describes is different, though often handled by the same courts and employing some of the same professional teams. A person may be declared incompetent to handle his or her finances and/or their personal affairs. A guardian/conservator is then appointed. This is commonly and legitimately done when dementia sets in and the person has not made provisions through a durable power of attorney.
Practices vary state by state, of course.
Added: I was professionally involved in a situation like hermannr described a number of years ago. There are no winners in those.