Feet cramping while stretching off the bike

I have a problem with my feet cramping while doing stretching exercises off the bike. This has been happening for at least a year. Whenever I extend either foot straight back from my leg, for example during Cobra or Child’s Pose, or hamstring stretching (like in the pic), I get serious cramping that causes me to break the pose. Anything that does as seen in the picture below with the rear foot causes almost immediate cramping. It’s been happening for a few months and I’m doing yoga and stretching at least twice a week, so just doing those poses more isn’t helping. Anyone else experience this? Any advice on movements that will help? I have a foam roller, a Stick, and a Theragun if you have suggestions that require those.
image