Like I said, the bug occurs only on specific sequences of moves, so you may just be lucky and your CAM doesn't generate the specific code sequence that induces the bug. I'd be willing to bet if you ran the OPs code (which he has posted), you'd see the problem, as one other poster here has already reported.
Regards,
Ray L.