Looking at a Counter on a limit switch is very instructive to show that debouncing is useful. It’s amazing how many counts you get opening and closing one of those mechanical micro switches.
I don’t know why you had a resistor on the switch but my team has used resistors without trouble. Wire length can be problem; the limit isn’t particularly long especially with resistors.
You didn’t say why you thought the Counter wasn’t working. I didn’t look at your code much since there is a ton of code to hunt through for your Counter.
I’m glad you found your problem - good job. I hope you didn’t fool yourself into thinking that a limit switch on the robot was ever going to be as clean of a contact as a jumper at the input. That’s why WPILib docs for years has shown how to debounce with a Counter and later provided debouncing methods.