I also had a very big life altering mental health incident very recently, drank A LOT of coffee during and I feel it helped, now I am much more calm, "more correct" despite drinking coffee like before.
Based on this I posit that coffee is used by humans to offset unwanted mentality changes, not a cause of unwanted mentality changes.
When I quit I get splitting headaches that are way more severe than a typical tension headache. Completely debilitating without medication. Get them for a week or so (also get the muddier thinking but I could live with that).