Lesson to be learned that most of us here already know, but you had to learn the hard way.
Shouldn't ever have made suicide threats to begin with, but besides that:
- NEVER talk to police. You should have never opened the door when they arrived.
- NEVER let the police in your house, ever, unless they have a warrant.
- NEVER voluntarily go with them to a mental health facility. You should have let them arrest you.
Unfortunately, since you agreed to talk to them, let them in your house, take your guns and cart you off to the loony bin, you're pretty much screwed.
You probably should get a lawyer at this point and now it's going to cost you a lot of time and money.
None of this would have happened if you just followed rule number one (don't talk to police).