Do you have input echo on??
I used to get this all the time with input echo switched on
I think what happens is that you automatically compensate for the lag by playing
the note slightly early so that you hear it fall on the beat
Then when sonar applies the compensation the note is moved slightly infront of the beat
hence slightly early
I now have input echo
switched off and split the guitar signal sending one to sonar and one directly to the speakers, so I hear the guitar with very little latency- It works for me!
If you do not have input echo on disregard my mumbleings