96 subaru legacy dying at idle

I have a 1996 subaru legacy (2.2L) wagon. A couple of years ago, we had to replace the engine after a head gasket issue. A couple months after this replacement, this issue developed. The car would be idling normally, and just quit. No rough idling, no warning lights - just on / off. It only occurs with the engine idling (stop lights, parked, etc.) and will occasionally be proceeded by a rough feeling transmission shift while driving (especially between 40- 55 mph), though I do not know if it is related. This issue is intermittent, and does not seem to occur until the engine has been running for at least some time. Normally the car will restart immediately, with a flashing A/T oil temp light that will disappear after a few seconds; however, sometimes it requires more attempts to restart, lately. I have taken the car in a few times, but, unfortunately, the subaru dealership could not replicate the issue. It is beginning to happen more frequently now, and I am about ready to take the car back in. I thought I would poke around here first and see if there was anyone with experience on what it could be.

I have cleaned the MAF sensor per instructions already - that seemed to help for a few weeks. I was thinking of attempting to clean the idle air control valve or replacing the fuel filter. Any help would be severely appreciated.

I would get under the hood and look for all of your GROUND Connections. During any engine swap…you have to disconnect all the electrical connections and several grounds… Its easy to miss a plug not being fully seated/connected…and or not attaching all the ground connections. Thats where I would start.

It can also be a faulty ignition switch losing connection…the switches DO go bad sometimes. Also does this vehicle have ANY type of factory alarm? That can be another avenue to check into.

When it stalls out…are there any lights illuminated on the dash board? If SO…it leads away from the ignition switch… The vehicle will give you many clues that only YOU or someone with the car can catch… Its difficult or impossible for us to find this issue without being there. All we can do is try to give you ideas to look into.

Can also be a faulty ignition coil pack… I believe your vehicle uses a 4 in one coil pack…when coils go bad they are HEAT sensitive…when they get hot they start to exhibit symptoms and those symptoms would be spark failure… just another idea…and along those lines…can also be the cam or crank sensor being heat sensitive and then losing signal…and thus…stalling out… If you were to pull the plug on either sensor while the engine was running…it would shut down immediately.

Like I said all we can do is throw ideas your way… If any sensor was going vbad…a code SHOULD BE stored in the ECU… Is your CEL illuminated ? (Check Engine Light) If there are NO CODES…it would indicate something outside the ecu monitors…like a bad ground or loose plug

Blackbird