Sounds exactly like my husband. For him it’s part sensory hallucinations, part panic attack.
I do this sometimes, i don’t know why. But now i’ve learned to talk to my partner about my aches and pains and usually if she feels it warrants a doctor appointment.