Hi and welcome to the community!
You simply need to stop putting your hair in a ponytail so tightly. I used to get the same thing when I was younger. It doesn't have to be super loose so that the hair falls out of the ponytail or it looks sloppy. You shouldn't feel a strong pull when your hair is in ponytail, that means that it is too tight. If it is too tight, move the band you used to make the ponytail up and down until it slides outward from the base of your head a little, then you should be fine.
It is probably also best to wear your hair down for a couple of weeks to let your hair heal. If you can't do that because of your job, it may just take more time for your hair to return to normal.
Yup, sounds like you're putting too much strain on your scalp by pulling your hair together too tightly for your ponytail.
'Specially since "a very loose braid" doesn't cause pain at all.
You seem to have a generally sensitive scalp however, and so you could possibly help reduce that problem by changing your shampoo to a non-residue one or a sensitive-scalp one, try the pharmacy for either, and by making absolutely sure that no shampoo residue is left in your hair after you wash it even if that means you have to spend 20 minutes rinsing out the hair. Getting a scalp-moisturizing conditioner may also help.
Also, I'd suggest going easy on any strong hair products like strong-hold hair gels, hair spray and dyes, as well as the obvious "let it down whenever you can so it can rest".
Keep trying different variations of putting your hair up until you find one that doesn't pull your hair at all in the meanwhile. Gentler, looser ponytails, using a big hair-clip instead of hair-bands to hold your hair back, etc, things like that, and you should be fine.