If reversing the wires solves your problem then it was just a loose or poor contact at the switch causing the problem.
You are not switching polarity when swapping the wires. Like a light switch, it only serves as a connection/disconnection point for electrical flow.