I've also run into this problem with MainStage 3 and I'm unable to find a fix. I don't think it has anything to do with how you switch patches (arrow keys, screen control mapped to a MIDI message, etc). The problem simply seems to be that if you switch patches with the sustain pedal down, once you release the pedal the sustain off message gets routed to the current patch instead of the previous one where the notes were sustained. The notes that were sustained from the previous patch are now stuck until you switch back to it and tap the sustain pedal (resulting in a sustain off message to that patch) or until you use MIDI PANIC to stop it.
A bit of history... this worked fine in MainStage 1.x but was partially broken in MainStage 2 prior to version 2.1.2. In that instance it was only a problem if you didn't have a sustain pedal control in your layout mapped to sustain. Most of the default concerts were already set up this way so unless you started with a blank one (as I did) or removed it you probably never ran into this problem. At the time I posted this question to the MainStage forum and got a response explaining the workaround. Even so, MainStage 2.1.2 fixed the problem -- it was specifically noted in the release notes.
I regularly play in musical theatre pits and it's pretty common for there to be at least a few spots where the keyboard book is written such that it's a necessity to do this. The situation is usually that you're holding a chord and you need to switch patches in the middle of holding it so you can be ready to play a new patch at the beginning of the next measure. You don't always have enough fingers or hands available to hold the chord manually without dropping out notes, especially when there's also a page turn thrown in too!
(Aside: If you use MainStage in live performance one thing I would suggest is mapping a button or key to PANIC -- I use the highest C on my keyboard. That way if you inadvertently trigger this problem you can quickly and reliably get it to stop.)
Has anyone found a workaround to get this to work correctly in MainStage 3? In any case I will be filing a bug report.