On my DC24 the Mains switch was very hit and miss when attempting to switch off the machine. It was changed by a Dyson engineer but you had to be very precise where you pressed it to get OFF action. Last month I changed both the beater bar switch and the mains switch, the first replacement switch I picked of the pair for the mains didn't stay ON. The other worked well.
Now after a month I have just realised that the OFF action of the MAINS switch is immediate and can be anywhere on the switch.
During the change I noted that the switch action on the apparent similar switches were in fact a slightly different push distances, approx. 1mm difference. This small difference would appear to make a lot of difference with the action, so when you have a problem just try changing the switches OVER you never know it may work for you two.