Opcontrol Code Not Running During Match

During a competition I participated today, in several matches my opcontrol code failed to run after the autonomous period. In both cases we had to stop our code and restart it in order to be able to actually control the robot, losing us valuable time. It was extremely inconsistent, with the bug occurring in 3 of the 8 matches we played despite running the same code in each of them. I have not been able to identify the cause of the issue, so any help or suggestions would be hugely appreciated. Information that may be relevant or important is listed below.
Firmware: everything updated to its newest version
Programming software: PROS
Again, thanks to anyone who responds, I’m completely lost on solving this.

Could you send the code so that we can see the problem? Also, is this v5 or IQ?

V5.
Check to see if your brain is up to date, because that caused us inconsistencies when we didn’t realize it was out of date. Code would be nice.

I checked my brain was up to date at the comp, but I’ll check again today just to be sure. When you say you want the code, do you mean the entire project? It’s really large.
Thanks for the responses.

just your main.cpp like a google drive or something

Alright, here is my main file and my autons file. I figured I should include the latter since the issue presents itself in the transition from the autonomous phase to the driver control phase.