Some instruments send CC64 codes other than 0 and 127. My Yamaha piano does. It sends a string of variable codes when the pedal is pressed. Half damper, different events controlling different samples, etc. I think I remember that it can be turned off if Sonar so that it only recognizes cc64 0 -127.
If this is not the problem, you will need to filter on the event list and be certain that for every 127 you have a 0. Midi can get screwy if not. I often have this problem happen during punches when you may already have a damper on and punch in with another on.
Good luck.