I needed an on/off power switch that uses a single momentary pushbutton. I came across this circuit:
https://www.edn.com/design/power-management/4427218/Latching-power-switch-uses-momentary-pushbuttonI simulated it in LTSpice using a BSS84 MOSFET and 2N2222 transistor, everything worked as expected.

(Note: V2 is a voltage controlled switch that simulates pressing the pushbutton. It is configured to make a 100 ms pulse every 15 seconds, and the sim runs for 60 seconds giving two complete toggles of the MOSFET on/off. V3 is just an anomaly of the Fairchild BSS84 model that inputs a voltage as an ambient temperature reference ie 25V = 25 degrees C)
I built the circuit on a PCB and it does not work. If I press the pushbutton I get this:

The yellow trace is the gate of the MOSFET and the blue trace is the drain of the MOSFET
The gate voltage never latches high, it goes high and turns off the MOSFET (the output on drain begins to decay) but then it begins to decay also and eventually turns the MOSFET back on.
If I momentarily apply the input voltage (5V) directly to the gate (i.e. not using the charge on the capacitor) I get this:

Which is exactly what it should do if the button is pushed. So the circuit can be toggled by applying a high directly to the gate but fails using the pushbutton. Any ideas on why it does this and suggestions to make it work correctly?