Audio recording is out of sync

Hi everyone.

I’m having an issue when I try to record a guitar with cubase. What happens is that recorded track is out of sync with both metronome click and the backing track that I have in the same project. Feels like it is slightly rushed.
To record the sound I’m using Focusrite Scarlett 2i2, plug the guitar directly into the interface and then use Bias FX for processing.
I have checked and I don’t have lag compensation enabled with the settings. I’ve also noticed that there are bars on the recorded guitar track, that are not aligned with project bars and that they are off by different margins each bar. Screenshot below.

Anyone knows how to solve this? Thanks