Piecebypiece

I’m making this game for the Mini Game Jam Puzzle Jam, and it seemed to be going well at first, but now when I put in the last piece, when I should win, it will say game over lose! Other weird problems similar to that have been happening too. Does anyone know what I can do to fix this?