When I squat, if I get down to near parallel I get a very sharp pain in my hip joint at the front, and groin on the inside leg. It feels as if the leg is out of position, or is loose in it's socket - that's the only way to describe it.
I stretch loads before squatting, and foam roll.
I have found that if I squat with a narrow stance the pain doesn't happen - only when in a wider stance. I can't squat heavy when narrow so it's not a long term solution.
I do have a slight disc issue in the lower back - at L4/L5. Nothing major, I'm getting treatment, but thought I would mention it in case you think it's related.
I had a similar groin pain for a while after tweaking it, but it went away. Squats at around 70-75% for doubles or singles paused in the hole helped fixing it.
If you can stay pain free with a narrow stance, keep at it. You'll eventually get stronger that way. Play around to find the least narrow stance that let's you squat pain free and stick with it. Remember bar position might need to change with stance width as well.
Speaking from first hand experience you aren't bracing properly, your tilting your pelvis back than hinging the hips back. You need stretch your glutes, hams and hip flexor, as well as actually train your hip flexors. I'm willing to bet you problem is almost completely from poor mechanics
Have you played around with the amount of stretching? Too much stretching and rolling can have adverse effects on muscular strength before heavy work. Im like that myself, I feel great stretching big before a heavy day but if I mildly stretch through the motion, I feel tighter but I tend to be much stronger.
I also wonder if your knees are tracking properly. It might just be a matter of being more conscious of knee tracking while you squat. Knees track the pinky toe. This can be much more difficult in a wide squat for many people.
Cues for this: -knees out -spread the floor -screw the feet into the floor
Is wide squatting your strongest squat? If not, it wouldn't kill you to stop a little above parallel.