Has anyone had strange issues playing in keys in relation to latency you dont hear, but Cubase plays back?

I was recording some piano parts at the weekend via Halion Sonic SE

I was playing them in time (not perfect), but when cubase played them back they were all ‘late’ in relation to the beat, and quantize made them worse?

First thing to try is to set your midi devices to use system timestamp.