I've suffered from leg cramps all my life concerning anything I did with sports. I followed all the common advice (hydration, potassium, stretching, etc) with inconsistent results.
Your experience in the pool or kneeling while diving is identical to mine. The only difference is that I usually don't get calf cramps, I get cramps in the backs of my thighs in my hamstring muscles. When doing a lot of kicking, I'll also get cramps in the front of my thighs too in the quad area. I found that bananas had the opposite effect on me, often increasing the tendency to cramp instead of reducing it. One day when fighting leg cramps while golfing I drank a protein infused electrolyte drink. The reduction in cramps was almost immediate. That got me thinking.
I did quite a bit of experimentation and came up with four solutions that have eliminated my leg cramping. First, as soon as I wake up in the morning I start hydrating with water. Second, for breakfast I eat a meal that consists of half a plate of protein (eggs, ham, chicken, fish, etc) and the rest carbs (fruit, potatoes, cereal, oatmeal, etc). I stay away from beef because that seems to increase the cramping. I also salt my food. Third, with the meal I take a B-complex multivitamin that does NOT contain potassium (Relacore is what I use and you can get it at Costco). I also take a second or third vitamin serving during the course of the day depending how long I'll be diving. With only two dives the morning vitamin is usually enough). And fourth, I hydrate between dives with water and a Gatorade type supplement (not full strength-usually cut it to 50%) or a protein infused electrolyte drink. When I have a meal during the diving day, I follow the same protein/carb mix as breakfast. I carry protein powder with me in case there isn't enough protein available on the boat. Protein is more expensive than carbs or fat so it is often the first to go.
I have completely eliminated cramping from my body while diving, golfing, hiking, etc. It doesn't even cross my mind now. If I mess up on the hydration, proten/carb meal, or the vitamins, the cramps will return on one of my later dives. If I eat a banana, guaranteed cramps. The protein and the vitamin supplement made the biggest difference. The hydration is normal. The Gatorade or protein infused electrolyte is just gravy and may have other uses for offgassing.
Try the protein and vitamins and see what happens. Can't hurt. If it works for you like it did with me, problem gone.