Is this pain on both sides when performing the couch stretch? Do you have pain at the back of the knee with deep knee flexion in general such as kneeling or deep squatting?
Could be as simple as cramping so some soft tissue work could help or it may help just to place something like a towel behind your knee. But if you continue to have discomfort with deep knee flexion you could always do a variation of the stretch such as the ½ kneeling banded (or without a band if you don’t have access) hip flexor stretch or stretching with a rear foot elevated split squat to avoid deep knee flexion and still open up the front of your hip. You can see demos of the variations below.