My wife uses ozempic and has had depression a long time before this.
However, my experience with rollercoaster ride of blood glucose levels along with depression and anxiety.
When your blood glucose levels are not in normal levels continually, it does increase the conditions, because your brain function is better without the highs and lows of glucose, insulin or other hormonal responses, that imbalances your brain function. The rapidity of the highs and lows exacerbate brain function.
Too much insulin is really bad, too much glucose is bad, unless it is controlled, by diet, drugs or insulin, diabetes has a likelihood of anxiety, depression, brain fog!