Something very strange going on. It doesn't make sense that the pedal works to remote control a function in SONAR by CC64, but CC64 is not recorded. The only things I can think of that could account for that that are:
1. Controllers unchecked in MIDI Record options - already verified checked.
2. An input channel restriction on the MIDI track - but that would also prevent recording of notes on that channel.
Even if there were a problem with the values being sent for On and Off, SONAR would still record the event. And if there were a problem with the pedal or the A-500, remote control would not work.
Some piece of the puzzle is missing. I'm out of ideas what that might be, other than some configuration corruption in SONAR or a specific project.
Have you tried a new project, started from the Normal template?