Also how old are you and body size?? I have heard that stimulants have a reverse effect on you if you're a smaller person, that is, younger, or petite.
Psychologically speaking, you may have coffee in your mind as a part of a relaxing ritual, similar to that sleepy feeling you get from hot chocolate or warm milk...in which case it will not be the picker upper it's supposed to be.
If you have the afternoon crash like a lot of people do, and this is when you get sleepy and when you drink coffee, it may be a coincidence. Most people crash about halfway between lunch and dinner (remember the Snickers commercials?) and it is a response to blood sugar and the fatigue is resolved by FOOD, not stimulants or sleep or fresh air. Even if you use a caffeine product, its effects may not be enough to keep you from being tired.
Related, maybe the setting you are in with your coffee is more powerful than the physical response to it. You said yourself that coffee is part of your bedtime routine. This will definitely keep you in the habit of falling asleep from coffee. It is a conditioned response. Did you always drink coffee before bed and then you noticed? Or did you know this about yourself, and then use the phenomenon on nights you can't sleep? There would be a difference...in the latter case, you are creating a stimulus-response pattern, just like Pavlov's dogs who salivated from hearing a bell, a previous pattern associated with food and bell together. If you drink coffee every night and then the next thing you do is sleep, you will want to sleep after coffee any time of day, again, a learned response.