Variable not updating after an estop

I am working with a UR5 robot and the program i am running is loading an unloading stations in a cell.

A variable is used to keep track of where the robots position is at which has been working well for the most part. Recently an estop was pressed and during the recovery of the robot a protective stop was triggered. After recovering from this situation and getting back to a running state, when starting to load the stations i noticed that the variable was no longer updating in the robot.

Between these events nothing was changed in the robot. Has anyone ran into this/ have solutions to make sure this does not happen?