@ musician2334 answer That latency is most likely your issue. You should try to bring it down as low as possible by using a smaller buffer size.
What happens: When you hit your keyboard's keys the MIDI is recorded (usual within 1 to 3 ms), however the sound you hear comes 46ms later. Human nature is, you start to compensate for the latency. But when the part is played back later on, the latency compared to the other instruments or click is compensated. From that moment it will sound different from the performance.