URScript program and joint errors - C264A0

It seems that your robot is UR3e of the e-series. The fault might be generated because of the usage of infinite rotation in your application and something wrong to the hardware connection. You could try to replace the wrist3, or even both of wrist3 and tool flange to solve this issue.