From what I see in the law, if you voluntarily committed yourself and were never held beyond the 72 hour observation period and certified by the doctors as a danger to yourself or others, then you never really lost your Federal rights. You could apply for the restoration of your state firearms rights after 5 years, and if the state restored you, the Federal government should be okay with that.
I can't tell you exactly what transpired in your treatment and what your records will reflect. You can ask the Superior Court
in your county to restore your firearms rights,if it's been more than 5 years. You'd be granted a hearing at which you would have the burden of proving that at this point in your life, you could safely possess a firearm.
However, IF you were held beyond the initial observation period or certified as a danger to yourself or others, the Federal government will never restore your gun
rights (See 18 USC 922(d)
So even if California gave you your rights back, you would still be unable to own, possess, or take control of a weapon under Federal law.
It's a legally tricky area of the law, and I don't have all the facts i would need to commit to a yes or no answer. This looks to me as if you can prevail on the facts that you've presented. But I'd double check with a California lawyer who specializes in the restoration of gun rights. He'd be a better judge of which way your petition would flip when it comes before the court for a hearing, since he handles them all the time.