So. You have the switch in place and it works if you operate it by hand and it doesn't work if you use the bit on the footbrake pedal/whatever.
Maybe check that whatever it is on the footbrake pedal/pedal arm/whatever, actually operates the switch properly.
Phdsr
June 2020