Check that the hydraulic tank vent is not clogged.
You might just leave the tank filler cap off and try it that way for a test.
My idea is based on the fact that if the tank vent is clogged and slow to allow air entry to make up for displaced oil, a partial vacuum or negative pressure might develop in the tank and cause the pump to "lose its prime" when the engine is not running.
And if you stop the engine with mast raised, lowering the mast would flood the tank..............and with a clogged vent.......the effect of the flooding return oil would be to "supercharge" the pump suction circuit resulting in instantaneous priming of the pump.
It bears checking out the vent system of the hydraulic tank.
This is ONLY to be used to report flooding, spam, advertising and problematic (harassing, abusive or crude) posts.