What Factorio version are you using? I can't reproduce it with Factorio 1.1.5
I made it crash on the same line on purpose and noticed that the line number for sandbox.lua is different (in your picture it's 71, for me it is 72), Did you edit that file?
I know why it is crashing, but the thing is it should be impossible for that field to be nil and fixing the crash almost certainly will lead to another one a few lines later etc.
As strange as it may sound, can you upload a save after you started the sandbox scenario and before clicking the button?