That will only happen if you change plugin settings, where the plugin cuts abruptly (eg plugin patch change), or if you change audio routine on the output of a plugin. To avoid abrupt cut off and have the ability to keep held/sustained notes sounding over state changes, you need to switch MIDI routing. For example, imagine a song with two parts, one piano with Ivory, another a synth patch with Omnisphere. Have two MIDI routes from your controller keyboard, one to Ivory (route only enabled in state 1), and one to Omnisphere (route only enabled in state 2). But both plugins are enabled in both states. When you change from state 1 to 2, any held/sustained piano notes will continue to sound from the plugin it was routed to, and the MIDI note off or sustain release control will still go to Ivory when it eventually happens. But any newly-played notes after the state change will route to Omnisphere, just as you’d expect.
This impacts a little on how you set up songs - typically you want to have all the plugins you need for a song enabled throughout, and do your sound switching by enabling/disabling routes. If you need to do patch changes on plugins (or racks), try not to do them at times when you need a smooth state change (or held keys); you may need two instances of the plugin/rack for this, if you need held notes on one sound and new notes on a new sound, on the same plugin.
Hope that makes sense.
Neil