Roy nailed it- - - -it's possible the movement of the engine on a bad mount is causing a loose connection to break contact, or a wire to short out. Try this - - - -Hold the brakes with the transmission in gear, forward and reverse, and give the throttle a little goose while watching the engine for movement. I think you'll be surprised at how much it moves around. Now look for a piece of the engine wiring harness that might be stretched or pinched as the engine moves. Hard braking while in gear will also allow the engine to move around wits similar results.
Jerry