Why do Robot get stuck in Autonomous sometimes?

Game: RingMasters
Our autonomous program runs fine most of the time but I cannot seen to understand why it gets completely stuck (only sometimes though ) while releasing the tray button. I tried to see in the debugger mode, everything seems fine. I am using the bumpsensor to do the job. I can see the value of bump sensor being reset, but still the robot is stuck and doesn’t seem to know what to do next. Please share any ideas on how can I troubleshoot this.

Put one of the RGB touch lights / buttons on the robot and put in your code to light the sensor at various parts of the program.

As all things programming, posting the code is a huge help.

Yes, be please post the code!!!

Frequent cause of stuck autonomous are blocking functions (such as moveMotor) unable to fulfill the exit condition. Like commanding an arm to move more than physically possible.
Even simple “forward(…)” can get stuck, if the robot hits the wall and the wheels have too much grip (or battery is too weak) to slip.