This happened to me, and I removed the cap completely to test and see if it was the actual encoder (meaning the board needed to be reflowed) or if it was the cap (meaning I needed a new knob.)
Turns out for me that the encoder is just fine, it is the knob that’s a bit worn. So rather than replace the knob, I folded up a small piece of paper and put it down into the top of the cap, and now it’s possibly even better than new.
On the old forum I took some pictures and posted them to walk people through this, but I don’t have the pictures any more. I’m sorry.
I hope this helps, and your encoder is working perfectly.