Oh my goodness, that sounds so funny!! The part that made it even funnier is that you thought that you had diverted the poop and then there it was in your purse!!
A similar thing happened to me with Hercules, except I wasn't out in public at least!! He looked like he was going to poop, so I scooped him up and ran downstairs and outside (this was before we decided to implement the "balcony park" on our balcony). Well I was wearing a hoodie sweatshirt with one of those big pocket in the front. So I get him down and I'm standing there waiting for him to do his business. I go to put my hands in my pocket, and of course, there's his poop!!
It's so funny the stories we have from these little guys and gals!