Let's walk through this: People who are insomniacs are more likely to get less sleep. Could this same group also more likely to take anticholinergic sleep drugs (diphenhydramine)? There is a good link starting to be established between those drugs and dementias of all types. See https://jamanetwork.com/journals/jamainternalmedicine/fullar..., or a bloggy summary if you're so inclined: https://www.health.harvard.edu/blog/common-anticholinergic-d...
The link is alarming enough you should think seriously before taking things like Zzzquil, Benadryl, Tylenol PM, etc. if you value your mental faculties.. But maybe the correlation in this article is at least partially explained by this other link. Personally the other theories (brain garbage collection during sleep, etc.) also make a lot of sense. And don't forget about the fungal theory: https://www.ncbi.nlm.nih.gov/pubmed/24614898