Sorry i should have mentioned that never pull out or plug in sensor grip on a running engine. It turned off because ECU didn't got enough time to compensate
the MAF signal loss when grip was pulled out.
Narrow down your diagnose step by step. Check all sensors and coils grip by grip.
[I suspect its MAF or faulty coil. Could be (cps) crank position sensor but faulty cps cause backfire ]