If you know any who would admit to taking certain Rx meds that could cause psychotic behavior, or who suffer with depression, etc., they’ve probably also been asked the same questions reguarding guns, especially if they admit to suicidal / homicidal ideation.
In that case I would disagree with what I presume is the majority opinion here. I don’t mind asking someone with homicidal tendencies if they have guns. They might not tell you the truth, anyway, so in the end it makes no difference.
For that matter, if a doc asks you if you have a gun, are you breaking a law if you lie or refuse to answer?