Had the same issue. For years I just kept turning my encoder at random (both directions) until by dumb luck I got the desire range. I used thru-hole 0.1uF and it was an instant fix. Someone mentioned that hardware/software debounce is inadequate or missing, and I suspect that's the case. Some posted that they open their encoder; and cleaned out the grease, but to me that seemed like too much work and risked damage. Another desoldered and replaced their encoders (with some debate on the replacement part#). A good hardware debounce might also include series resistance, and even some added hysteresis; but I didn't want to cut traces or add any extra chips.
I suppose we risk some increased long-term degradation of the encoders contacts, by having it close a capacitive load without and in-rush reducing resistance (maybe 100R to 1K?). When you can't scope the signal, and there's no schematic, it's hard to know exactly what's the best fix.
Thanks to this forum and the many posters that upload awesome photos, diagrams, links, and experiences/advice!!!