Have you tested the alternator for proper operation? Sometimes it takes a while for the brushes to conform to the shape of the slip rings. The alternator has to be working in order to keep the engine running. If the computer senses no alternator input, it thinks there has been an accident and shuts down.
Problem might be with ignition coil or fuel pump. Check them. When u crank do u hear fuel pump sound in fuel tank. If yes check the fuel line at the injector rail. If ok check the spark from the ignition coil.