There are numerous reasons as to why this happens. But I’d like to severely stress that no pain is ever normal. Soreness, fatigue, weakness is fine. But my friend is a massage therapist and she has informed me of this habit of pressing into the back of the neck for extended periods of time can lead to carpal tunnel. She’s currently treating a guitarist friend of mine for carpal tunnel. If you are having to press THAT hard into your neck to where it hurts, I’d suggest checking out the action on your guitar, the gauge of the strings, and even the shape of the neck (D shape, C shape, etc). All of these can have a huge impact on the ease of barring a chord. There’s a reason why classical guitarists have such light feeling, gentle strings when they play
In conclusion, I would check into all these factors and make sure you are applying equal pressure of a “squeeze” when barring. It could be something as simple as your index finger and hand muscles aren’t strong enough yet. But NEVER EVER place 100% of the burden on your thumb
If you can buy one of those “finger gripper strengtheners” like at a fitness store, or even squeeze a stress ball (my therapist friend uses a soft tennis ball) it’ll help build the strength in your hands. I hope this helps!