Interesting to see this thread now, I had my first incidence of this a few years ago, 2015 I think. I scoured the web looking for info and found almost nothing, except a few forum threads where other cyclists were discussing the same phenomenon. The longest-running, most informative thread seems to be
this one, but even there no real concrete answers, despite some people making several visits to various specialists.
One thing I'll say is that these are not really cramps, that's just the closest thing I can think of to describe them. Anybody who's gone through this will tell you that these 'cramps' are very different from normal cramping caused by over-exertion or lack of fitness. Interesting that this thread discusses it in the context of running, since all the other discussions I've read were from cyclists (although walking/running downhill can definitely trigger an attack).
In all my searching, I've yet to find any diagnosis in humans that matches the symptoms of this. The only thing that matches, is tying up in horses. There's definitely a diet-related component to it in my experience, the first few times this happened I was coming off a heavy training block, and during a holiday weekend visit with family I was not only off the bike for a few days but was eating lots of junk during that time. It seems to be some combination of a sudden drop in training volume combined with high carb intake. I've also noticed that several of my episodes were preceded by travel (either plane or car). Hydration/electrolytes may or may not come into play, I can't say for sure in my case.
My first few 'minor' episodes were after a weekend off the bike eating/drinking too much as mentioned above. First time back on the bike, the 'cramps' started within a couple of minutes and I had to stop the ride. This lasted for a few days, I would keep trying to get on the trainer and spin easily till the cramps started, stop spinning, repeat. Eventually you hit a point where you can ride through the pain and once I do that, they just stop and I can resume normal training.
I had one episode that was much worse in severity/duration. I was in probably the best shape of my life, and crashed out of a bike race. Frame was damaged and I was pretty banged up, so I was completely inactive for several days (and eating tons of junk out of frustration). One morning I got up, walked around a bit, and then when I sat down BAM the cramps started out of nowhere, except they were much worse this time. I could feel the cramps 'travel', moving between the different muscles in my thighs. Pretty much any time I bent my knee, the cramps would start again, and for several days in a row I would wake up in the morning to severe cramps. This episode lasted a while, probably 8-10 days. Part of that I think is because I hadn't made the connection to diet yet, also because I wasn't getting on the bike or doing anything else active. Eventually I realized that rest just prolongs the episode; to get through it I had to eventually start trying to ride (even though it would be just a few minutes of soft-pedaling at a time to start).
I've gradually learned how to prevent these episodes. The biggest thing is to avoid a sudden drop in training volume/intensity, especially if I've been doing VO2max work. Multiple rest days or even a few short/easy recovery rides in a row can be enough to cause an episode, especially if I'm not being careful about my diet. Fortunately I've learned to recognized warning signs, there's a certain feeling my legs get (I call them tremors), that tell me that I need to ride in the next day or so or I'm going to be in trouble. And if I know I'm going to be off the bike for a while (eg for vacation), I need to gradually reduce my training in the week before. The absolute worst thing would be to try to cram extra training in right before leaving on a trip.
Nutritionally, I make a point of trying to match carb intake to training load, when I reduce training, I need to reduce carb intake to match. I also make more effort to stay hydrated throughout the day and keep my eloctrolytes up (I take magnesium and potassium supplements).
The only real problem is unplanned interruptions in training due to sickness or other reasons, when I can't cut training gradually. It also makes tapering for an A-race tricky because if I back off training too much I'll be in trouble. The best taper I've round is to ride every other day and make sure there are at least a few hard efforts in each ride. But taking a rest day right before an A-race is always scary.