Note that this is an article making huge claims about Alzheimer's but is published in Molecular Psychiatry. Given that signal, I'm just going to look at the abstract and not read the full text.
Here, the study population is patients with rheumatoid arthritis. This tells you up front that we don't have a typical population, but a highly selected one.
The use of HCQ is observational, not randomly assigned.
So, how could HCQ look protective even if it had no effect on Alzheimer's biology?
1. Maybe more rheumatoid arthritis patients should be on HCQ. It's a disease-modifying drug, after all. So it may be the case that people with better care, or more wealth, are more likely to be on HCQ. And that could be associated with other lifestyle factors that are never fully accounted for in an observational analysis.
2. Or it could be the case that people with dementia are less likely to have their HCQ prescriptions renewed, so the arrow of causation could even be reversed.
Additionally, one could imagine that HCQ might actually protect against Alzheimer's disease in people with rheumatoid arthritis—but not in a general population. That would be very big news, but would require further study.
And sure, it could be the case that HCQ reduces Alzheimer's risk in everyone. But you'd need a lot more evidence to buy that.