Switching Rackspace in Setlist mode

Dear Community,
As an total newbie in scripting I have tried to solve an issue with help of the GP Script Documentation and have failed.
An brief explanation of my goal:
Our repertoire has more than 200 Songs and a lot of them use similar Sounds. As an solution I create in the Global Rackspace a Setup with 6 Instances of different Synths. They are played with two Keyboards. I created widgets to control the different splits when needed, gain controls for the mixer and buttons to bypass the plugins when not needed. This Widgets were then replicated in an Rackspace were a lot of variation accomplish my needs. The first Variation set all widgets on zero and bypasses all plugins. The reason therefor is that for the song which cannot be played with the Global Rackspace, further sounds are needed with other Plugins and different routing builded with additional Rackspace.
The Rackspace are tied accordingly to the corresponding Song.
The issue with this strategy is that when in Setlist mode a Song with use of the GR switch to song with use of another Rackspace then the GR keeps the last state. This leads to unwanted sound results. (Normal Rackspace + Global Rackspace)
My first solution:
(Rackspace Script Editor)

var GlobalSynths : String = "GlobalSynths"

On Deactivate
// Called when you switch away from a rackspace
    SwitchToRackspaceByName(GlobalSynths, 0)
End

This has worked in Rackspace mode. When I go to the Setlist than the script logger scolds that “Rackspace switching only allowed in Rackspace view”

My second try:
(Gig Script Editor)

var GlobalSynths : String = "GlobalSynths"
var wantedRackspace, wantedVariation : Integer

// Called when you switch to another song
On Song(oldSongIndex : integer, newSongIndex : integer)
    var ActRackspace, ActVariation : String
    
ActRackspace = GetRackspaceName()
wantedVariation = GetCurrentVariation()

    If ActRackspace <> GlobalSynths
	Then
		SwitchToRackspaceByName(GlobalSynths, 0)
		SwitchToRackspaceByName(ActRackspace, wantedVariation)
	End
End

And again I got the same message from the Script Log.

My third try is to ask kindly for help in this very informative and helpful forum.

I’m pretty sure that the solution for professionals is very trivial, but I also hope to learn something.
Thank you in advance

Why so complicated Global Rackspace?
Just build rackspaces and use that in Song Parts.

Or do I miss something?

As @pianopaul said: why so complicated? If you still want to use a few common plugins in Global Rackspace check How to control widgets from the Global rackspace in a regular rackspace? to create your rackspaces or variations for your setlist.

@CharlyBass
You cannot switch the rackspace associated with a songpart from GPScript. That would break the whole concept of a songpart.

Thank you for your quick response.
Your suggested solution I already use for a few songs.
The reason for the GR-Strategy is that this sounds are needed at the same time in different constellation with the two keyboards. (Split setup and/or different controls from the keyboards)

@tripleB as you can see in my screen shot I follow that concept and it works just fine. Thank you

Unterstand.
My actual approach avoiding GPScript is to create an DummySong where I have associated the ALLMute-Variation from the GlobalSynths-Rackspace.
Trank you for your support.