years ago had a Cat 420d, still do but when I first received it would only run high RPM on initial start, would run all day at 50%, had the dealer work on it couple times best they came up with was a switch to activate the lift pump, after a few years started digging into it and found a relay on the frame under the cab noted as lift pump relay, it was dropping out when the motor started, besides was a fuel shut off relay and this was activated by the key, when turned to start the relay would close, pump relay was activated and it started, problem was once the motor runs you let go of the key, at this point the pump relay should be latched to keep pump running but it was dropping out
changed the relays and ran 100% since that time, when the pump runs no air is getting into the lines but when the pump drops the injection pump is sucking and had lots of air, at lower RPM the air significantly reduced and it ran fine
may be a similar issue to yours