With input from Dr.Mukesh Tiwari (Orthopaedic Surgeon)
Thank you for asking your query at DoctorSpring.
The swelling looks like a Ganglion cyst. This arise near joints and ligaments due to accumulation of fluid. This most likely has no relationship to the pituitary lesion or the other systemic symptoms you are having. The pain during the bout of illness is due to the inflammation of the cyst (as like any other part of the body).
If the cyst is troublesome it can be removed safely by a simple surgical procedure.
Hope this helps
Please feel free to ask followup questions.