Thank you for the information and sorry for the delay. I am on the east coast and I'd turned my computer off for the night by the time your response came through.
Here's the issue: 18 USC 1922 (d) makes it unlawful for anyone who has been "adjudicated a mental defective or who has been committed to any mental institution" to have anything to do with firearms. That has been construed by the courts to mean that if the institutionalization was involuntary and/or ordered by a court or an agency you have lost your Federal gun rights.
Without your Federal rights, you don't have state rights either. So the police do have the authority to take your weapons from you when they initiate a 5150 action. From there, California requires a waiting period of 5 years after an involuntary commitment before you could possess a firearm again.
If you'd been formally adjudicated a danger to yourself or others, the suspension of your California rights would be indefinite in duration and you'd have lost your state and Federal rights. But that was not the case with you. You'll have to wait out the suspension period, but you should not have permanently lost your state firearms rights.
Your Federal rights, on the other hand, are another story, for you were involuntarily committed, even if you were released within hours. Without Federal rights, you have no state rights no matter what California is willing to accord you. After an involuntary commitment, the Federal ban against your gun rights is for life and there is no way to restore it.
So you can get your California rights back, but you may have difficulty thereafter with the Federal government. If you are denied the opportunity to have a weapon because of the Federal government, you can appeal that on the basis that you were never even held for the fulll observation period and see if the Federal government will agree with your interpretation of the facts and circumstances behind your commitment.