First thing to check is fuel
Then, the second thing is -- fuel.
The third thing to check is -- fuel again.
Only after that, start thinking about anything else. 97% of problems like this are caused by fuel (and 98.6% of statistics are just made up
Change the fine filter and try to run the engine from a jerry can of clean fuel, bypassing the primary filter/water separator and all the fuel lines up to the fine filter on the engine.
Check the injection pipes and injector connections for cracks or leaks
Obviously, bleed the whole thing, but note that the 4J's are theoretically fully self-bleeding, so very unlikely to have any effect.
If the symptoms remain after every possible fuel problem has been eliminated, then check the exhaust elbow
for carbon, and have a look at the turbo vanes, feel the turbo for smooth bearings. Have you ever done the turbo wash in the maintenance
schedule? I have never heard of a Yanmar 4J with any problem caused by carbon in the elbow
or dirty turbo impeller, but you should be careful to follow the mechanic's golden rule
-- ALWAYS check the easiest stuff first, working your way slowly and systematically up to the more complex stuff. The injection pump should be the last thing on your list, and by the way, it is extremely rare for them to create this kind of problem.
If you do get as far as the injection pump, then you just take it off and take it to an authorized service
station to be bench tested. After the bench test, you will know everything about the injection pump, and the lift
pump which is built into it, eliminating all of that as a possible source of the problem. Albeit expensively, as the bench test costs a couple hundred, and taking off and putting back on and properly adjusting the pump is a PITA which might require professional help.