This just happened to me in Pokemon Red when I left Mt. Moon with my only Pokemon that had not fainted, my poisoned Charmeleon. Once I took too many steps, it said that Charmeleon fainted, it said I blacked out, and it brought me back to the Pokemon center BEFORE Mt. Moon. Truly a sad experience, at least I can help somebody through my experience though.