Check ECM ground(s) and power supply connections to coils/ignition module.
Bad or intermittent connections will cause exactly what you describe-sounds ignition related to me.
The connection may LOOK good, but is it really?
Wait for the condition to happen and wiggle the connectors at the coil/module and at the ECM ground point and see if it changes things. If it does-clean and tighten the grounds and check the plug(s) at the coil/module for continuity while bending the wires a bit where they enter the connector and examine the contacs in the connectors closely for buggered up contacts/corrosion.