I think he knew he wouldn’t have magic outside of Stroybrooke hence why he brought Belle back over the town line before he attempted to throw the fireball at Hook. In the bathroom, I think he was so used to healing himself with magic, that it almost became second nature, and the fact that it doesn’t work was a sharp reminder that he has no control over the situation. He was antsy before he entered the bathroom, he’s trying to hold it together, and the fact he injured himself by punching something signifies that the cracks are starting to show in his facade. It makes you wonder how many other times Rumple has done something like that and then just healed himself?