Not saying this the problem, but a friend of mine had a hot rod that did the same thing. Turned out to be a cold solder joint in the main battery ground cable to the block of the engine.
I would check all such cables/connectors/joints, including the ones on the ignition switch. The easiest way to find the problem would be with the engine running at idle, and wiggling wires/connectors to see if you can find one that makes it quit. Good luck, and welcome to the forum, CC.