Caffeine is supposed to block the receptors that tells your body you are tired. Which is why I’m wondering how it could no longer be effective. Though, maybe a “reset” through stopping coffee, as some other have suggested, is all that’s needed.
I used to drink about 3 liters of tea, daily, for years. And I slept just fine. Then I stopped drinking tea. If I have tea now, which is very rare, even early in the morning, I know a sleepless night is what's going to happen.