Judges should not be involved. They have no expertise in anything except making a mess of things.
Why must we give so much deference to black robed lawyers?
Judges are either elected or appointed to make such rulings. They should act as a check against excessive power being put in the hands of mental health professionals; a profession that suffers from an epidemic of incompetence and quakery and always has.
Judges would likely normally defer to the combined judgment of family and psychiatrists, but they should ensure that those parties can show convincing cause to take away the liberty of an individual who has committed no crime.
It is called due process of the law.
Why do you give so much deference to white coated liberal quacks who couldn’t cut it as real doctors?