Hello, I hope I can offer you some assistance.
The fault code P251A won't be the reason for the loss of power, this fault code relates to a Power Take Off (PTO) circuit, this fault will have been logged in error from a previous software update on the engine management control module.
You need to have the software checked and updated as necessary but make sure all necessary parameters are entered when required.
With regard to the actual loss of power check for stored fault codes when the fault occurs. If no fault codes are stored then you need to check live data from the engine management when the fault occurs, check the fuel pressure demanded and actual any discrepancy of around 20 bar will result in the engine management switching to Limited Operating. Check that the pressure relief valve hasn't activated in the end of the fuel rail if it has then the engine management won't be able to control the fuel pressure. Replace the fuel filter if it hasn't been replaced recently, if possible check the injector operation as a faulty injector will cause fuel pressure concerns.
Check the EGR valve operation, if you can't hear it cycle at ignition off it may have seized although this normally leaves a fault code.
Let me know if I can assist further and I'll reply to you as soon as I'm able to.
Best wishes and merry Christmas,