I was able to figure out what the issue was. Turns out that the buttons on the pause and ending screens (mostly the ending screen) can still be clicked when they are invisible, and it seems that you were accidentally clicking on the "Replay" button from the ending screen. I uploaded a fixed version of the game, so the issue should be resolved. Thank you for playing my game and the feedback.