Of course an arahat could never have any anxiety or depression - they have uprooted all defilements.
There are a few examples of ariyas below anagami like Visakha who cried after her grandchild died. And the daughter of Anathapindika who was unable to eat due to her disappointment in not finding a suitor.
or Mahanama:
“Lord, this Kapilavatthu is rich & prosperous, populous & crowded, its alleys congested. Sometimes, when I enter Kapilavatthu in the evening after visiting with the Blessed One or with the monks who inspire the mind, I meet up with a runaway elephant, a runaway horse, a runaway chariot, a runaway cart, or a runaway person. At times like that my mindfulness with regard to the Blessed One gets muddled, my mindfulness with regard to the Dhamma… the Sangha gets muddled. The thought occurs to me, 'If I were to die at this moment, what would be my destination? What would be my future course?”
They had all uprooted wrong view and have absolute confidence in the Dhamma. But they still have avijja and dosa and lobha - thus when conditions are right such things can happen.
The Chemical Imbalance theory of mental illness has been pretty much completely discredited and debunked by the scientific/medical community for about the last 20 years:
“Chemical disbalance in brain causing various mental conditions” is truly a false materialistic idea according to which nama is simply a result of rupa. It’s literally the other way around: these kinds of “hormons” are consciousness-born matter resulting from the correlating cittas, which appeared owing to natural conditions. Or, when we are talking about “mental effects of psychotropic drugs”, it’s rather mental reaction through moha to this or that kind of tangible datum, so there appear various mental states correlating with the datum received (if a datum “contains” too harsh elements of fire/earth - irritiation and aversion, if the elements there are subtle and refined - clinging and bliss, etc.), and on top of that there comes drug-caused obstruction of the 5 sensory indriyas, owing to which the mind door is becoming more clear to manasikara (attention) – this causes so called psychoactive effects. For example, when you drink coffee, it’s not like its substance gives “energy” for your mind like directly, its rather about causing harsh tangible datum (the coffee getting absorbed in bowels and being spread to blood), and mind with moha reacting to that, as if “mirroring” the datum’s quality of elements, that your mind gets energized (the tangible datum of coffee is really harsh, as if you gets punched, so mind reacts accordingly). If you have really strong sati and panna, such drugs cannot work on you, since they are becoming just another specific tangible datum.
And yes, stream-enterers can become depressed and whatever, but never insane/deranged in like schizophrenic way, since moha after first phala gets weakened enough to not be able to work like that. Sort of depression or even mental breakdown happened once to Venerable Ananda after the Buddha’s death, when he (Ananda), in sorrow and lamentation, used to do his vattas (monastic duties) to the Buddha (like bringing water etc.) in the Buddha’s previous kuti, talking to him as if the second was still alive; like: “Here’s you bathing water Blessed One, it’s time to bath, I have prepered everything for you” etc. Of course, it wasn’t insanity, but very bitter feelings of loss, and he clearly understood that it wasn’t real.
cattāro diṭṭhigatasampayuttacittuppādā, vicikicchāsahagato cittuppādo – ime dhammā dassanena pahātabbā.
cattāro diṭṭhigatavippayuttā lobhasahagatacittuppādā, dve domanassasahagatacittuppādā – ime dhammā siyā dassanena pahātabbā siyā bhāvanāya pahātabbā
All possible domanassasahagatacittuppādā are not completely cutoff at stream entry. But no ditthigata sabhavas or vicikiccha sahagata sabhavas can ever arise again.