In my experience and somewhat in my subjective opinion most all arylcyclohexylamine dissociatives actually have a far longer duration of aftereffects that most people give them credit for. It's true that the majority of acute aftereffects will be gone within a day or so but in my experience (and again, my opinion, I guess) there are more subtle side effects that can persist for weeks, and can be hard to notice unless either you are specifically looking for them, or are particularly sensitive to them. In my case I think I was both although I kind of ignored it for a long time. Eventually I did start to notice a significant degree of apathy, demotivation, brain-fog which would persist for at least a week after a dissociative binge, although even after starting to remember the predictable pattern of emotional fluctuation I usually only remembered around a week or so post-binge when I would somewhat suddenly start to feel a bit better and would be like "Oh yeah... this is what usually happens".
These "aftereffects" do not necessarily seem to be negative though, a good proportion of people experience them as an afterglow, and the anti-depressant effects of ketamine which are said to persist for a few weeks at least are probably somewhat dependent on whatever mechanism produces this afterglow. Sadly I can't remember ever experiencing it as an afterglow myself, but the fact that this drawn out "hangover" is not necessarily negative is probably a significant factor in the oft-reported minimal length of ketamine-associated aftereffects. Nonetheless, for the aforementioned reasons, it's not actually that surprising to me at all that you experienced a long and drawn out "hangover", as you put it. I think it takes a while to become "attuned" to these effects, if you do experience them negatively, and they may not always have been negative, or even significant in any way, but the character of the ketamine experience and probably aftereffects does have a tendency to change over time, probably partly due to the extremely persistent effects of dissociatives on NMDA receptors which results in the permatolerance often discussed by seasoned ketamine users - so neither is it surprising to me that you didn't experience these effects before but unexpectedly experienced it after a particularly heavy session combined with a stimulant.
I was just about to say finally that I don't think the caffeine had anything to do with it - but, actually, having considered it, in my experience having done too much ketamine in my life and experienced progressively worsening aftereffects, the acute NMDA rebound following a dissociative binge can be made worse by stimulants, and I wouldn't be too surprised if an increased amplitude of NMDA rebound would correlate with significantly increased uncomfortable aftereffects, both in intensity and duration, as happened here. That said - I think the likelihood is that you would have experienced a drawn out hangover anyway, caffeine is a fairly benign stimulant and while it may have made it worse temporarily, it would probably not have massively amplified the duration of the aftereffects, but perhaps it did have the effect of making you more aware of them in a way that you had not been prior to this experience.