chicken or egg
Maybe first the injector connector fell off, causing the engine to run on one cylinder.
When you took the cover off, you may have bumped the release on the qd. If the qd didn't come out far enough, it might not have shut off.
Spark from loose injector cable completes the process.
Next time I would shut off the motor (and fuel pump) asap and investigate.