It gets more fundamental than this. These laws for involuntary commitment are civil laws and lack the protections of criminal court. The hearings can be ex parte, you don't have a right to an attorney, and proof is only what is more likely than not and not beyond a reasonable doubt. If you had a lawyer at the hearing and the proof required overcoming reasonable doubt, then there would be fewer abuses (one would hope anyways).
These types of abuses happen with all the "institutional" civil laws - involuntary commitment, civil asset forfeiture, guardianship, red flag, and especially protection from abuse orders (weaponized in divorces fairly commonly). It will continue to increase as we, as a society, continue to favor quick and easy "fixes" to overcome the protections found on the criminal side.