Here's your problem, you are not specifying a map to load with your gamemode switch. It'll load without a map.
The current most common way is with the votemanager resource. If you don't want to use it, the mapcycler resource provides the functionality you want, you just need to provide it with gamemode/map rotation. Details on the maplimits wiki page.
If you want to stick to your scripting option, I recommend using
table getMapsCompatibleWithGamemode ( [ resource theGamemode ] )
and then choosing one at random to insert into changeGamemode.
But using the actual way we use, when it loads the resource, inside have a meta.xml
This is not valid?( please notice it sometimes load, and sometimes not its random )