Mine was doing exactly what you describe.
Fortunately I am used to left foot braking from some old racing experience, so driving around with my right foot on the throttle to stop it from stalling while I used the left foot for braking worked for me.
Eventually changed out the EGR valve and it fixed the problem. Old valve was stuck half open, so when the engine tried to idle, it was not getting the right mixture. EGR valve should be closed at idle.
Have a listen around the EGR valve - if you can hear a soft whistle, or hissing noise, but feel no air flow, that is your problem.

PK