When shifting from forward or reverse into neutral the port engine (only) cuts out. It can then be restarted. Intermittent fault that becomes more frequent with increased frequency of moving into neutral such as when practicing berthing.
On many engines there is an interrupter switch that purposefully cuts the engine for a moment when switching gears so that the engine slows when changing drive directions. I understand these can be adjusted or go bad and need to be replaced.
Although a sail boat owner, I was once told invaluable advice for diesels. They basically keep running (once started) unless there is a fuel problem, i.e. restriction or air in fuel.
If the engine idles happily, then we need to know a tadge more information. Revving it out of gear, does this also cut when returning to neutral. If yes, then are your idle revs too low? If no, then there is a fuel return value (on mine at least) that was kaput - it let air into the fuel when you slow revs down very quickly. Try reducing revs quickly and slowly to see if any pattern emerges.
I am assuming that your filters etc are clean and dandy.
If this only happens when really in gear, then perhaps your gearbox is very stiff or hard to run and is stalling the engine, but that is far reaching in my humble opinion.