Hi Philip,
You're right, there are always confounding variables that can't be controlled for, so we shouldn't take any study too seriously. However, looking at meta analyses can be helpful because it's not just one study, but rather a bunch that all indicate the same thing.
In regards to waiting for an hour after waking up, I write more about this in my article:
But to summarize, we have a natural spike in cortisol when we wake up, so adding caffeine to that both causes more stress on our bodies while at the same time making the impact of the caffeine essentially non-existent, meaning we get habituated to caffeine more easily.