Don't use the MIDI learn with the right click on a button, just use the MIDI panel and set the MIDI ccs there and it will all work fine, just find the element you want to map, then select it in the list, hit the midi learn button and move your CC (you can also set the value manually if you know it).

I'll check mainstage (i have it) but never tried the MIDI assignments in it.