Sounds like a vapor lock, except I don’t think Diesels are susceptible to vapor lock.
I would first start with valve adjustment. Contrary to popular belief, valves wear tight, and valve clearance goes away when hot, too tight, means leaking valves and low
compression.
Plus it likely needs checking anyway and doesn’t cost
money to do.
I like to start with easy and
cheap first, before advancing to hard and expensive with trouble shooting.