Baneboo's Lost Object!? - S7-E39
Continuity mistake: When Ash tells Corphish to use Bubble Beam after Team Rocket's Pokémon during the first battle, his bag disappears. This also happens when Ash tells Torkoal to dodge Cacnea's Needle Arm. (00:07:52 - 00:19:02)
Answer: Yes it ran away because Layla hurt its feelings.