Maybe the weight was too heavy and/or your form was off...
When doing shoulder presses you should keep your whole body pretty much motionless and stuck to the bench and the only things that should be moving are you arms. Check your form for sure because if you got a pain in your NECK when doing SHOULDER presses....think about it