Apparently if Wrap is used to kill something the next Pokemon that gets sent out has the aftereffects applied to it. A Bellsprout killed my Diglett with Wrap and the Gastly I sent out was afflicted by it so I was unable to run and even took the damage at the end of the turn.