Current zero cross detection circuit off of triac
The app note







simulate this circuit &ndash; Schematic created using CircuitLab

App not swapped:







simulate this circuit

Your intention:







simulate this circuit







simulate this circuit

Since the signal is AC it does not need to swap NPN with PNP transistor.






simulate this circuit
 Result: