It used to be the case (and maybe still is) that you could have someone involuntarily committed for drug detox and/or for serious mental health crisis. 72 hr. hold. My inlaws tried that in desperation with my BIL who had serious substance abuse issues. It did not work.
My understanding is that it takes a threat of suicide to trigger such a lockup, but the only crazy I have any connection to is not in the US legal system and the problem isn't one of self-harm, anyway.
I understand that there are circumstances where it can work: say someone with serious bipolar disorder or schizophrenia feels better on their meds, to the extent that they believe they don't need the meds anymore, so they go off, lose their equilibrium and need hospitalization in order to stabilize again. This is me, making up the circumstance under which involuntary commitment might be worthwhile. I do know absolutely that it is an issue for some people with some psychiatric illnesses going off their meds, believing they are cured or feeling that the side effects are causing them more problems than the disease.
It's seeing the side effects as worse than the disease. Usually a false perception (their memories of the time off the meds are often inaccurate) and often the burden falls on those around. If you don't pose a danger to others I think it should be your choice, but I have very little tolerance for harm inflicted in such situations. Off your meds should be a major aggravating factor in any criminal case.