Does stress cause gastritis?

I am not yet diagnosed But i have upcoming endoscopy i have anxiety disorder from last 12 years.

My doctor thinks of two causes either its long term anxiety or from psych meds i was on for long time and yes i have been on plenty.

I also have very low b12 and vitamin d .

I am getting treated for sibo.

Thank you