Yes, you are on the hook for the bill even if involuntary. You made some kind of statement which indicated a threat of self-harm or harm to others. Each state has different requirements and process for it. I'm in Massachusetts and it is commonly called, "being sectioned", as the form is from Section 12 of a Massachusetts General Law Title VII Chapter 123. Here is the link if you'd like to peruse the relevant law. https://malegislature.gov/Laws/GeneralLaws/PartI/TitleXVII/Chapter123/Section12. That is for Massachusetts but every state has their own version of it, who can issue it, and what must follow. In Massachusetts you are required to be evaluated by a mental health professional within 72 hours of being involuntarily brought to a healthcare facility in which case the provider will either extend the hold or release it.
As far as the bill unfortunately you are responsible for it as you received the care. The good news though is medical billing is something of a shellgame. Most healthcare systems receive reimbursement through insurance whether public or private. These insurers negotiate favorable rates with these healthcare systems to show effectiveness and cost reduction. The healthcare systems know this so the, "sticker price", for services is often well outside the actual cost and this is where it benefits you.
I worked for a decade in a private 911 system. We based our operating costs on an average reimbursement of about $250 because that was the average payment we received from insurance. Public was lower and commercial insurance higher but that was the average. We, and all similar companies, "billed" about $1500 to ensure when Blue Cross paid it's rate it came out to a number we could have a margin on. The remainder was billed to the patient but this was never money we expected to collect. Ever. Patient's don't pay, just don't count on it. Eventually the bill is sold to a collection agency for less than pennies on the dollar. So anytime a patient would reach out to settle a debt our billing department had tremendous latitude to settle at a lower price because anything after insurance pays is practically free profit. A $5k bill could be settled for far far less.
Different healthcare delivery systems work differently but they are all not counting on patients settling their full bills. Persistence is key. They will negotiate and you can get the bill down considerably and in some cases even waived. I'm sorry this is the system we exist in but I hope this helps.