I had that happen to me on numerous occasions, the 1st time it dumped my dog out into the middle of a very busy road, then it dumped all my shopping in the road, and the last time it nearly took out a cyclist who was behind me! I now have it hooked down via a dog lead attatched to the boot strap and hook it onto the floor hoop (D ring thing).
I did take all the trim off and undone the bolts that hold th catch, cleaned it up and then slightly readjusted the catch.
It seems to not do it now but i always strap it down just in case.