Problem - Read from Closed Loop Stepper Motor while Rotating

That should be INPUT_PULLUP, or better still add some physical pullups to the encoder lines, perhaps 4k7 sort of value, to prevent noise-pickup affecting the count.