What about electrolytes (magnesium/potassium especially)? A lot of times people will actually over do it with post workout hydration which floods the system and flushes electrolytes. The key is to slowly and steadily rehydrate as well as make sure you also take in electrolytes. As mentioned by others, PH and Skratch are fantastic products. They are expensive though so I usually go with SIS.
If this helped then I would log your post-exercise hydration habits and consider if the above applies to you. That being said some are just more prone to cramping. I used to be the same way (middle of the night, typically right calf). Damn painful and always out of nowhere. It’s been a long time since it’s happened though and the only potential cause I can identify is dietary changes (more healthy fats, less refined sugars, more salts and other electrolytes).