It can happen. You should not look at the planet and the comet in isolation- there are other gravitational forces at play, too- for example, that of nearby moons, planets and the entire solar system.
Occasionally, the orbital positions may create a situation where the forces from those external fields, or from orbital eccentricity, may allow for the captured body to escape.
Slapping my forehead! Seems obvious now. I guess I was preplexed at the capture and release aspect, thinking too simply to realize that obviously near-by bodies would also be interacting too.
Thanks all.