I had a similar experience but I eventually found that sticking to a consistent 8hr sleep schedule and doing a quick 20-30 minute physical warm up first thing in the morning fixed the problem.
Another possibility is that coffee enforces some level of ritual and regularity into my mornings. Since I have a physical dependency on it, I'll go out of my way each morning to get caffeine and usually induce some tangential benefit, whether that be by brewing some coffee (benefit - I usually make breakfast while waiting on it to brew), by going to a coffee shop (benefit - I go for a walk), or by taking preworkout (benefit - I get a workout in).
So I guess if I was able to be super consistent about some alternative positive morning ritual (like a physical warm up) maybe it would fix the problem of feeling more depressed when not drinking it.