Just tell the truth. Medical is a perfectly valid reason. Tangent: What does it say about hiring culture that a gap of 3 months is a potential deal breaker? Like anybody who would ever deign to not be employed by choice is unhirable. God forbid that people are defined by anything other than having a career working for others. A person's worth is not defined by how much economic value they create.
I sure do know my medical is not related to mental health. Is it reasonable to somehow indicate that or it should be better left for an interviewer to inquire?