Does anything move or flex when you put weight on the back wheel? Like, if you have loose-ball hubs, and your bearings are too loose, you could have sideways movement that could affect shifting. Or if you have too much frame flex for some reason. Or a broken axle.
Other possibilities:
- cable too tight (as suggested already)
- too much side-to-side play in the RD (but a little bit of play is normal, and not a problem, in my experience): one of the pivots could be worn, or loose (unlikely, but possible), or the upper jocky wheel could be worn or loose.
- too much side-to-side play in the freewheel, if it's been ridden in dirt and wet a lot
A good cleaning of the RD and the freewheel cogs would be a good place to start. And if you haven't replaced the cable (and maybe the housing), that couldn't hurt.