I can't get access to the full article either to see how they adjusted for confounding (which they said they did) - but I thought this tidbit was interesting:
https://www.massgeneralbrigham.org/en/about/newsroom/press-r...
“We also compared people with different genetic predispositions to developing dementia and saw the same results—meaning coffee or caffeine is likely equally beneficial for people with high and low genetic risk of developing dementia,” said lead author Yu Zhang
That seems like it indicates there is some real, independent signal here. Off to make some coffee!