Sometimes when I try to stand from a sitting position my hip will lock causing excruciating pain. This started a couple years ago, but when I went to the doctor he didn’t seem too concerned. Just said it was old age arthritis. Even standing it would sometimes lock up at the hip joint.
There are three things that this could be. First is arthritis which is the most common. Second is a tear in the cartilage rim that goes around the socket (labrum). Third is a loose piece of bone/cartilage floating around in the hip joint. Treatment is quite different depending on the problem. I would recommend an evaluation by an orthopedist with an interest in hips to determine the problem and solution for you.