Wow, this is going to triple in the next decade. The poor woman that was put into a psych ward, how arrogant of the doctor. I would sue the arse off of him, for negligence and misogyny. Having had similar attitude from male doctors in the past relating to women’s health issues.
Stand your ground and ask for referrals to specialists and find another person doctor if possible. Age is a factor in being dismissed by a doctor because the doctor may think that you are too young for a particular disease or condition. Even dementia can happen in younger people, it is rare but does happen.