I had the same problem in my left hip for a number of years and saw a wide range of health practitioners. The solution for me has turned out to be very simple: sleep on my stomach. This allows me to keep the leg extended. Maybe it won't work for others, but it's easy to try it. Back when I used to get the pain during the night, a solution was to get up and walk around for a while. Then I realised I could achieve relief by lying on my stomach (thereby mildly stretching out the psoas). I change position inevitably during the night but by favouring an on-stomach position I no longer experience night pain in the hip.