Add a nut to the rotary encoder shaft. This will act as a spacer when mounting it in the case so that it does not interfere with the potentiometer.