The article in the attached link is rather long and verbose
for the layman but it makes a point about the importance of
checking the physical cause of symptoms.

Medical Conditions With Psychiatric Manifestations

The  above article explains how each of the following can manifest as
various psychiatric disorders:

Traumatic Brain Injury: mood and anxiety disorders.
Epilepsy: hallucinations and panic attacks
Multiple Sclerosis (MS): depression and anxiety
Thyroid Disorders: hyperactivity, depression, impaired memory,
paranoid delusions, sleep disorder, weight loss, fatigue, anxiety,
obsessive-compulsive disorder,
Adrenal insufficiency: depression, poor appetite, weight loss,
irritability, delirium and coma
Diabetes: depression, anxiety disorder, eating disorders including
anorexia nervosa

Taken from the above-mentioned article –
Medical Conditions With Psychiatric Manifestations by
O’Brien, Rebecca Flynn; Kifuji, Kayoko; Summergrad, Paul

Here is a personal story from a friend:

“We had a cook working for us. Her daughter had celiac disease
(but not yet diagnosed) and the doctor wanted to put her on psychiatric
drugs because she had difficulty concentrating (she was starving to death).
When she was finally diagnosed with celiac disease, she changed her diet
and seven months later had grown four inches, gained weight and had
leaped ahead two grades.”

In the book, “A Dose of Sanity” by Sydney Walker III, he gives
numerous examples of his own patients where they had been
diagnosed with psychiatric disorders and he always could find
the actual physical ailment that was the cause.