I'm doing a 6 challenge and got trapped in a treasure room. The Great Crab 🦀 cannot be injured and I cannot escape. Had to end this game. I've played hundreds if not thousands of games and never had this happen before.
Even if I use the key , the crab moves so quick that it's right on top of me and it would not be surprised which is what is required in order for me to hit it.
I'm gonna hope you didn't walk in while followed by the crab and was instead exploring when it came it.
Also, what items did you have? Apart from the already mentioned use-the-key there may have been other options. The blue crab moves slower than the player which allows some room to play with.