What were the earth worms there for? I find it hard to believe that you accidentally dropped a worm into a ball python's cage at the exact time you opened the cage, and that the ball python ate the worm before you were able to reach in and get it out.

Are you sure you didn't think that ball pythons ate worms, so you dangled a worm in front of it and it ate it, only to later find out that ball pythons eat rodents? If you did, it's no big deal. It shouldn't harm the snake other than maybe some loose, smelly crap, and at least you know better now.