Midi timing problem

I’m on Nuendo 10 so not sure this will apply, but I had the same issue with MIDI notes being shifted noticeably forward after recording.
The fix for me was found in studio/studio setup/MIDI Port Setup. I checked the box marked "Use System Timestamp for “Direct Music” Inputs and for me, this solved the problem.