I had something similar happen to me in the first six months of HRT: very painful erections. I told my endocrinologist, and she measured my prolactin levels, and simultaneously sent me for a MRI of my pituitary gland.
She's a smart lady. What I had was a benign (non-cancerous) tumor called a prolactinoma in my pituitary gland. This sort of tumor produces an excess of prolactin, and that prolactin was causing my painful erections (not quite sure why). The prolactin also causes the tumor to grow.
The tumor probably started when I began HRT. Apparently it's known to arise in women much more than men, and it usually is discovered in their thirties (which matches me exactly).
The good news is that it is usually easily treatable with a medication called cabergoline. The medicine drops the prolactin levels, which stops the growth of the tumor. And, within a month of starting the cabergoline, the painful erections stopped and never came back.
If you have one of these tumors (and I am not saying you do, just that it's a possibility to consider), it's good to catch it early. Mine is only 3 millimeters in diameter. When they get larger (a centimeter or more), they can cause your pituitary to press on your optic nerve, causing vision problems. Otherwise, it's a pretty easy tumor to have.
Sent from my Pixel using Tapatalk