For years, I've struggled with sleep. OK, make that a lot longer than a few years, but the last few have been pretty bad.
Due to an entirely different set of circumstances (leg cramps - I've had them for a long time now, decades), there came a recommendation to add potassium to my diet. So, I started to eat a couple (or more) bananas each day, a baked potato, etc.
Once I did that, the sleeping has become pretty good. Not excellent mind you, but a radical improvement from where it's been for the last few years.
Yeah - I know - anecdotal. But the timing is so completely spot on and the results so good, I'm comfortable in aligning the two for myself.
I've also found that some societies (Thailand, IIRC) actually espouse eating bananas as a treatment for insomnia - so maybe it's not K, but something else that comes with... dunno. But it's worked for me so I thought I'd share.