One thing that happened to me, actually impressed me not figuring it could happen.
My bike was going in and out of adjustment no matter how much I adjusted it. Turns out that if I looked inside the lever, I could see that the cable was starting to fray right at the bead. Surprised me as I would have never thought to look there.
So in other words, look there! Could be a cable beginning to fray.
Also the worn chain on cog set thing. And the barrel adjuster tension on the cable.
Easy rear der cable adjustment. Shift gears to outermost cog. Make sure it is corresponding to the shifter, last click, last gear. I've been fooled before.
Once certain it is in synch, turn the barrel adjuster so that it starts clunking and starts rubbing the wall of the next cog up (almost as if it is going to begin changing up a gear). Once you hear or see the rub, back the barrel off about 1/4 to 1/2 turn. That should put you right in the ball park. Maybe a hair this way or that way if needed.
I've done this for several cyclists on the road who were having trouble. Works well unless there is a problem. Then look at cables, etc.