I just bought a new '03 wrx wagon 2 months ago, had 400 miles on it from the dealership. Just about 10 days ago it started randomly shutting off on me and was displaying no codes. After much wire tracing, the dealership said the "main relay" was sticking that's supposedly some central relay to a lot of sensors.
If anyone of you have this strange shutting off and your mechanic is scratching his head, it's a thought. My new car was in the shop 8 days for them to figure that out and fix it =(

Happy motoring.