Exactly.
No one can be committed unless he is judged by police (and psychiatrists) that he's liable to harm himself or others. All states have laws that allow such to be committed--temporarily--(usually just for 30 days--enough to get them stable on their meds). Such folks are just the kind that should NOT have guns.
Only insane people want insane people to have guns.
Get real people.
Most of the time an emergency order for involuntary commitment for evaluation and treatment is for 72 hours. After that certain procedures which must take into account the rights of the person so committed must be observed. Such as right to have a hearing in front of a judge to appeal the finding of a psychiatrist who wants to hold the person for a longer time.
But hey I guess if paranoid schizophrenics are not allowed to keep their guns without adequate precautions taken to assure their safety and the safety of others we will all have our guns seized and be taken a ride to the FEMA camps in the morning.