Unplugging any sensor makes the ecu to go into presets aka limp mode.....
Unplugging your maf just makes the ecu fire in as much fuel as it can at per rpm point.
The car is misfiring and won't rev and its a diesel.
It's not going to be valve timing, its not compression so that leaves just fuel. Like the dealer said. From reading what you've said and not seeing the car personally I still agree with their original diagnosis.
Sand is sand. Sand in places where tolerances are fine not surprisingly ****s them up big time. Aka injector pump and injectors.
You can think of water, you can wonder how it happened you can unplug and test a million other things but its not going to change the fact that your injector pump has sucked a **** load of sand and pumped it through.
In regards to people saying the engine is too complex to be fixed in a desert....go buy a TDI THEN! Duuuuh.

