hmmm...
Again this isn't really my area of expertise BUT it is definitely sounding like latency of some kind.
Are you programming the MIDI notes/arrangement INTO the keyboard THEN sending it to Sonar as opposed to playing the performance live on the keyboard into Sonar? I know that's probably a confusing question but the difference (to me) would be creating the performance in the internal editor on the keyboard then having that transmitted to the computer as opposed to having the keyboard write the notes directly to Sonar.
I do not even know if that could result in this or if that's even possible with this device but such a transmission seems like it could cause such latency (and hopefully the more apt members can take that and explain further).
As far as the keyboard displaying to "MIDI" clock instead of "internal" suggests it's syncing to Sonar's clock (so the keyboard is now using Sonar's MIDI Clock instead of it's own internal clock). That's what you want because it means Sonar and the keyboard have sync'd to each other.
Soooo... and again I am absolutely not any kind of expert on this, this sounds like you are trying to transmit a MIDI pattern/program you are creating on the keyboard (instead of in the Sonar PRV or other MIDI data input areas) then when you are "Saving" the keyboard is then transmitting the data in real time but there is a slight "latency" (which is just a fancy way of saying there is a delay in signal which is incurred by the data having to travel a bit from the source to the target).
If this is the case then there are some options to manage this type of "MIDI Latency" in the Sonar Edit > Preferences - MIDI options.
However I personally don't understand those settings all that much (I'm mostly an audio clown and don't use external programming devices aside from direct controllers controlling softsynths) so others will have to chime in.
Short (after typing it up it's not so short) version of all that...
If you are recording, programming and editing the MIDI composition directly into your keyboard's onboard memory then try instead using the keyboard to
1) transmit your current composition to Sonar (which it sounds like you have already done multiple times) then
2) learning how to/then using the keyboard as a "dummy" controller to input the data directly to Sonar. In that scenario instead of the MIDI composition getting written to the internal memory of the keyboard it gets written to Sonar (or more accurately your hard drives via Sonar).
As chuckebaby (howdy chuck) pointed out the lack of a proper audio/MIDI interface can introduce such latency so even live playback from the keyboard can introduce latency and even if you mess with the MIDI "buffer" Preferences to get rid of the latency that might cause other problems (such as nasty noise issues).
If absolutely NO interface is possible at this juncture there is a program called ASIO4ALL (which should be avoided at ALLLLLL costs) that can be used to minimize latency until such time that you do find a proper interface with a proper "ASIO" driver.
Again ASIO4ALL is an entirely NOT RECOMMENDED stop gap solution but on a computer with absolutely NO proper interface it can help reduce latency and provide better results.
I have just likely confused the heck out of you and I apologize for that but now you have a bunch of things to reasearch, consider, reply to and hopefully some smarter folks can analyze the situation further and guide you into some low latency joy.
Most importantly answer these questions...
Do you have an ASIO audio Interface attached and installed on the system?
If you go into the Sonar "Edit > Preferences > Audio - Driver Settings" options area what driver mode is being used? (ASIO, WMD/WASAPI, KS, MME)
Again... apologies for likely confusing the heck out of you and not being able to give you a simple answer.
Good luck.