What we really know for sure is this – sleep is good, anxiety is bad. So, if you aren't getting good sleep, find ways to fix it. And if you are anxious all the time, find ways to fix it. By one tradition that's thousands of years old – Yoga+Pranayama+Meditation (linking physical/mental_movement+breadth) and fasting + eating moderately (eat only if you are hungry and eat enough to quench hunger, and eat 'satvik' food)…
I'm one of those that seem able to drink lots of coffee even at 6 or 8pm and still fall fast asleep.
I also don't feel any different during the day whether I drink it or not. Though I usually still drink it, for various reasons like taste, warmth and social aspects.
People always want to find simple universal dietary rules.