Given that your symptom is related to hydration, I wonder if the pain could be related to kidney stones. An internet search gives me an article that says the pain location may move as the stones move around:
https://www.healthline.com/health/symptoms-of-kidney-stones#...