Possibly.
I used to get very bad cramps in my calves years before I ever had T2. They were due to the diuretics I was taking causing me to wee out vital minerals - mainly potassium. My solution was to eat a potassium rich banana a day.
But I also had similar issues early on with my low carb diet,. Excessive wee was not only disposing of surplus sugar but vital electrolytes too - again potassium, and magnesium, & salt as well. Since high carb bananas are now off limits for me, I make sure that I include potassium & magnesium rich foods (e.g. leafy green veg, avocados), drink enough water - and don't stint on the salt.!
Google helped provide me with suitable low carb food lists.