Presumably if its a twinair with only two cylinders and it has a misfire then thats not going to sound good and is going to make for a very unbalanced engine.
The fact the noise comes and goes is more of an indication that its not something major failing like big end bearings Not impossible, but seems more likely.
If its not a twinair then I might be a little more concerned.
You might need to either take a video and record the sound next time it happens or get it put on diagnostics to see if any errors are being recorded.
In a petro you can get misfires for a number of reasons but in a compression ignition engine ( diesel) especially if it’s warmed up it’s really unusual to get a misfire
I can’t think of what else could cause that sort of symptom of the top of my head right now.
What’s the service history like ? When/had it ever had the timing chain replaced