Hi,,, these are a "fly by wire" system so unfortunately go wrong quite often.... the simple way to explain it is that you press the pedal... which is attached to an electrical switch... the more you press the more "electrical signal" is then given to the computer.... the computer then decides what to do with this signal and sends another electrical signal to the diesel pump on the engine...
so.... first thing to do would get a diagnostic test done by a garage to check the accelerator switch is sending a signal....the pedal itself is a switch and can go faulty.. if you can find a second hand one for testing then just swap it...
second thing is all the wiring and connectors between the pedal to computer, and then computer to the engine diesel pump....any loose connection, worn away wiring if its rubbing or corroded wiring if its trapped with water next to it will cause "weird" problems...
third thing is to check all the plug connections onto anything attached to the engine... the computer reads many things , like fuel pressure,air temperature,engine temperature..... any "weird" reading given from any of these will cause the computer to not work in its correct sequence... so it simply gives up until it decides to do something...
lastly it could be a new part required but the list is very long.... First thing is always the accelerator pedal... it moves millions of times in its lifetime and simply wears out so if I was just guessing at a part, Swap the pedal first..