Issues Reading an encoder

I have added the voltage dividers for the inputs. Sure enough it didn't fix my issue. With this mod things even got worse: if with the 5V straight to the Arduino inputs it was only missing pulses in one direction and was pretty much consistent (3 pulses for roughly each 2.8 revolutions of the encoder repeatedly), then with the voltage divider it misses pulses in both directions and in an erratic manner (sometimes 1 pulse and other times 10 and more pulses for the same amount of revolutions).

By the way, measured the voltages and found that the 5V Due output that I was using to power the encoder was 4.8V, while the signals (no load) coming from the encoder were 5.9V. Very odd in itself - how the encoder's circuit manages to amplify the signal above the rail voltage?! Anyway, with the signals connected to the Due they measure around 3.4V.

I truly believe the voltage incompatibility is not what causes my issue. Furthermore, since the inputs are still functioning, I believe they were not damaged either.

Any suggestions why is my code missing pulses?