Ran into this during the enemy's attack during the tardigrade + sponge fight. Not sure how this happened as the error occured when I clicked the 'x' button in the top right corner of the window.
Edit: After a couple of minutes with the game and 'code error' windows open, the game window turned black.