Here's some more information about how I'm switching layouts:
1. I check if both client and server are ready (via connection.Send({"action": readyToggle"}) and myserver.SendToAll({action": readyToggle"}) ) Client and Host can both change their ready status by checking a box, and each of the readyToggle functions update global vars corresponding to that.
2. The host checks if both ClientReady and HostReady are true (the globals mentioned above). If they are, it sets a global "starting" to 1.
3. When 'starting' is 1, the Host does:
myserver.SendToAll({"action": "ready"}), which just sets the Client's 'starting' to 1 as well
then it does myserver.Pump() and System.GoToLayout("Layout1")
4. At this point the Client's 'starting' is 1, which just calls a GoToLayout on the Client but without pumping any connections (so same as above except no myserver.Pump() or any other .Pump().
5. Both Client and Server are able to get to the new Layout, at which point I get the error message I mentioned.
6. In the new layout the first round of the game starts and both the host and the Client immediately call a readyToggle2 action which repeats every so often as it is checking to see if the Client and Host ready states (if they submitted their game orders, it's turn based game).
7. These actions are followed by myserver.Pump() (the one causing the problems I think) and connection.Pump and myclient.Pump(), with the myclient.Pump in a try/except block