I friend of mine had a seizure & blacked out. The Dr. put him on some special med's & for safety, invalidated his drivers license for 6 mo.
You can see the comparison I'm making here. Suppose your Dr. prescribed an anti-depressant or other mood drug. Perfect excuse to confiscate your guns & then the burden to prove your ok again is on you. Good luck with that...
Sad days in America...
We can play "what if" all day long, but the key point is that your friend wasn't involuntarily committed for treatment or declared to be mentally defective by the courts. That's the bar we have right now before someone becomes a "prohibited person", and it's pretty darned high, just as it should be.
We can push for better reporting from the states to the NICS database without wanting everyone who's ever been prescribed Xanax to lose their gun rights.