The root cause of all this crap is that rob(o) or the robot being viewed, has a velocity of some huge number.
It only happens when rob(o) is fixed
The cause is that somewhere down the line, the accelerations are just being added to a fixed bot and velocity is not being reset.
Answer. Reset all .vx, .vy, .ax and .ay variables for all fixed bots on every cycle
If my previous fix didn't work I think it may have been because it wasn't resetting accelerations but was only resetting velocities. Accelerations are added to current velocities later in the program cycle so if accelerations continue to grow, then eventually we are going to add one that pushes velocity out of bounds.
That would explain how my previous fix allowed the program to run for longer before crashing since it wasn't compounding the error on each cycle.
Try this instead.
If .mem(216) <> 0 Then
.Fixed = True
.vx = 0
.vy = 0
Else
.Fixed = False
End If
and change it to
If .mem(216) <> 0 Then
.Fixed = True
Else
.Fixed = False
End If
if .Fixed then
.vx = 0
.vy = 0
.ax = 0
.ay = 0
Endif