Hi,
if you stretch like that (I assume you did not open your legs during the stretch) and any of your hip-joints and / or the sacrum still has misalignments you immediately worsen this and due to the cranio-sacral connection it influenced your neck.
You may consider to stop any stretching until you are better.
Hope you are getting there soon.