I went through a food inventory a while back after having all kinds of problems which I won't list in entirety here but waking up with night sweats and painful cramps were a couple along with getting up to pee 3 or 4 times a night and a few others that were downright scary.
I cut out pretty much all processed foods for a while then stopped eating wheat, seafood, dairy and beef entirely. Talk about a limited diet. Long story short, everything is back except dairy in any form. No butter, cheese, whey, milk, yada yada ... not a single thing that lists any milk based ingredient or may have been made where dairy might contaminate it. It's not a lactose intolerance it's more like a genuine dairy allergy.
Cramps are gone, sweats are gone, don't get up to pee at all. Still don't sleep much but that's always been a problem so maybe I'll try the magnesium glycinate.
Point being, different people have different triggers.