I bought a 2002 Legacy with 145XXX miles on it for my 19 year old son. A couple of weeks ago, (after we owned the car for 30 days) he was driving at 55 mph and came to a stop light. When he went to go, he pushed on the gas pedal and nothing happened with acceleration, but the entire dashboard lit up. Car was still running but no revving of the engine when hitting the gas. He coasted over to the shoulder, turned the car off and it restarted. On his return trip it did the exact same thing at the stop light. The only difference was there was a loud knocking noise and it wouldn't start. We had it towed and it was about to throw a rod. Towed it to the place where we bought it and they installed a used engine. Had the car a few days and once again, my son is driving it and it looses power and the dash lights up. This only happens after he drives a higher speed and slows down or stops. He gets home and I drive the car the next day and it happens to me. The guy we bought it from tows it to his shop they check the alternator/battery and nothing is showing up. No codes. They take the car out and can't get it to replicate the issue my son and I have had. They're hoping it will so it will show a code. Any ideas? At this point, I don't want the car since I feel it's unsafe but not sure how difficult it will be to get our money back.
Check that the two earth straps are in place; there's one on each side of the engine, attached between the engine and the body. You're looking for two braided cables, about six inches long each. It's easy to forget that their there (I've ripped out several when removing Subaru engines)
Edit: I didn't look at the OP date before replying, just saw this in recent activity. Leaving my answer to help in the future, anyway.
Is this car an automatic transmission? And if so, does it feel like a manual car with a dragging clutch? Can the engine rev in neutral when in this condition?
If so, the torque converter might be somewhere to look. That is part of the coupling between engine and transmission, taking up approximately the same place as a clutch would in a manual. Normally (when stopped, moving slowly, etc) it relies on two parts turning in a viscous fluid to transmit motion. Because that is inefficient, though, at cruising speeds the converter can physically "lock up" to create a direct mechanical connection, like an engaged clutch. If it doesn't unlock, the engine should stall when the car stops -- but maybe there is some "partially locked" mode.