If you lose to that giant mother bug, it puts you in front of the nurse at the no power town, but it still has it saying you're in the tunnel with the fire type gym leader. It then continues to TP you back to the cave once again and then when you go to the nurses house, it'll automatically heal in that moment only.

Just something I thought you should know about so you could possibly fix.