Was the motor running and did it have oil pressure? If it was not running, or was running and did not have oil pressure, the switch would not provide the voltage through it. The switch would be working correctly.

However, if the motor was running and did have oil pressure, the switch is defective.