When you say dies for a few minutes, you mean engine turn off and even cranking will not start? Then suddenly, It may start back?
If so, I would suspect the fuel pump (1rst chance) then CPS. Unfortunately, either you catch it wile bad behaving, or you will not ever know for sure if you changed something unnecessarily. My fuel pump let me down a couple times before I decided not to take the car for a ride until I find the problem, when removing the pump from the gas tank, I start connecting and disconnecting it from a battery source and noticed some times it didn’t run, so changed it and the problem was gone forever (up to now I mean). My CPS also failed once, but it did positively, so was an easy catch. Got a friend though, that was let down by his 318i M42 engine several times by a bad CPS (getting worse over time).