You're supposed to have an acryllic aquarium with him so he can't break it as easily, but if he broke the aquarium, you'd have to hope: A) he isn't dead by the time you found out, or B) you have an extra one somewhere. I think it would be hard to save him unless he's more lobster than anything. I think I've seen lobsters live outside of water okay, but of course they can't do it for too long.
I was surprised when I found cooking recipes about eating Peacock Shrimps lol. It seems more like a bug than a crustacean to me.