This can happen for a few reasons.
For the sound patch loaded for the track who you entered the notes for, are these notes within the playable range of the instrument? I think Sonar's decision as to what note is middle C differs from some synth vendors - maybe the outs are out of range?
Also, is it always the same notes that do not play? (Perhaps there is a dropout issue - that could be a buffers thing, a driver-mode thing, etc.)
Can you please list your driver mode, your reported latency values, your sample rate, and your record bit-depth? (And any other information you think might help). Also, how loaded up is this project, with tracks and synths and whatever? (perhaps too much is being asked of your computer to be able to keep up).
Thanks,
Bob Bone