hi
Are the errors occurring while the encoder is connected to the motor? that could be just a number/sampl9ng rate thing: the processor misses reading a few encoder states.
Are the errors occurring when you turn it by hand? One thing in my experience is that encoders aren't designed to be accurate when turned by hand: the hand jitters at the start and end of a rotation. A motor, by contrast, usually doesn't do that: it starts slow, ramps up to speed, slows down and stops. It doesn't turn backwards at any point, which the hand does just for an instant when turning an encoder. Try and hold your hand steady for a few seconds, without moving more than the say 1mm resolution of movement that the encoder gives, and you'll see what I mean...
D