The main relay under the dash is for the EFI only - not the complete electrical system.
As far as I know there is no complete electrical system relay, and the key switch does not control the complete electrical system - the vehicle has, so to speak, two electrical systems, one that is hot all the time (the unswitched system), and one that is hot only with the ignition/acc on (the switched system) - and these come togther at the under hood fuse panel - so - if you're having a complete electrical system shutdown, there are a very small number of places it can come from.
The battery itself, the battery connections (both positive & negative), the cable from the battery negative to chassis ground, the cable from the battery positive to the underhood fuse panel, the underhood fuse panel itself, and the main fuse in that panel.
The key factor here is in determining that it is in fact a complete system failure.
About a year back I have a very similar experience with my GV - it started when the wife was driving - the car would buck and the check engine light would flash on and go back out (she reported a yellow light, that came on & went off too quickly for her to read it, and the CEL is the only yellow light on the dashboard).
My intial assumption was that I had an engine or ECU related problem that was causing the engine to misfire & buck, however, later that day - after night fall - I discovered the true problem - the vehicle was losing ALL electrical power for a split second, and the engine would die, but because it's a 5-speed, and was rolling, it would restart as soon as it got power back.
What brought this to my attention was that ALL the vehicle lights and the radio would go dead when it bucked - very easy to see at night, but a lot more difficult to detect during daylight.
I checked the battery & chassis ground connections, all clean & tight, I removed the underhood fuse panel and inspected it, all clean & tight. No amount of rocking & shaking any of the electical connections with the engine running and the lights on caused as much as a hiccup or a flicker.
At first, I didn't think it was the battery because the engine would crank & start every time - but it was the last thing left on the list - so I changed it - and the problem was gone.
What you have to determine now is if you are losing ALL power, switched power or only power to the EFI system.
Switched power does pass through the ignition switch, the EFI system will have a main relay that may be controlled either directly from the ignition switch or indirectly through the ECU.
On second thoughts - you're only the ECU to drive the fuel pump - or is that a different vehicle?
It's hard to tell with an engine swap how you wired it - so what I've posted above would apply to a standard vehicle.