that's pretty much what i did the first time i whooped her in the games, took a magnemite in there and she couldn't do anything.
I really do believe this battle was done alright, yes i know people will and still do whine because "OMG Palpitoad comes back to die and sevre as useless cannon fodder!?" but the way the fight was executed was unique, and we got to see how crippling poison can really be, which is rather shameful that we didn't get to see such things back in the first season with Koga, but I digress on that.
Now as for Ash's little "confidence break" moment, let's think about this. He took six of what he believed to be his strongest current pokemon against Roxie and was giving it his all, I don't think anyone wouldn't feel the same if they had to watch what they considered thier best six get taken down by three, I mean look at how depressed and down the other trainers who challenged roxie were in the previous episode from having lost to her, it's easy to get overwhelmed at times and lose confidence as a result, Ash simply felt the same pressure, and thanks to Iris and Cilan was able to recover and continue on to win.
People really gotta stop hating battles just because one or two of their fav pokemon got ko'ed, it happens to all of Ash's guys at somepoint.