just reading through these posts and I have encountered a similar problem, I have a 05 3litre turbo diesel d22 .
About 2 months ago I was on the way to the shops when the car started surging while driving and revving about 1400-1700rpm at traffic lights. On the way home from work that day it cut out completely a few times but restarted pretty much straight away. Mechanic said it was something to do with the accelerator fly by wire drum or switch (not sure the exact name) but he reset the computer and said everything is working ok now see how it goes. All was well for about 2 months then it's all happened again. I went and brought a new accelerator setup and I installed it myself as Nissan advised me it could be done at a fraction of the cost they do it. Took it for a 2 hour drive on my way to the tyrepower store on Saturday and it was fine. got new tyres installed and as soon as I got out the gate it started again.
Any information or tips would be muchly appreciated.