This puzzle is taken from the book The Ultimate IQ Test Book by Philip Carter and Ken Russell.
If everything's working, all lights are toggled twice
So the switch that isn't working is
The switch that toggles only 3/4, leaving them with an odd number of toggles. This is Switch D.
I'll use a Truth table to solve it: $0$ representing off, and $1$ representing on. Note that the switches are basically inverters.
Apply $D$ $[1,1,0,0]$
Apply $C$ $[0,1,1,0]$
Apply $A$ $[1,0,1,0]$
Apply $B$ $[1,1,1,1]$
Real output: $[1,1,0,0]$
Bulbs $1$ & $2$ are correct. This likely means the bulbs that worked on them are working. I.e $A,B,C$ are working. $D$ should be the faulty one. I can verify this, by rerunning the sequence omitting $D$
Apply $C$ $[0,1,0,1]$
Apply $A$ $[1,0,0,1]$
Apply $B$ $[1,1,0,0]$
This gives us the final value.
$\therefore D$ is the faulty switch.