I had the same problem, and I found the issue. The reason this happens is the first line in InitPlayer (control.lua, line 30). If global[player_index] already exists, then the button in the top left corner never gets created, causing the error.
Steps to reproduce the crash: start a user scenario. Then press the keybind to enter the lab.
How to fix: remove the first line of InitPlayer . This check isn't necessary, because CreateGui calls playerData.flow.clear() before creating a new button.