I have created an animation with this robot, and everything looks fine and normal in the viewport, but once I render it out in any render engine it does this weird thing that you see in the first image. The second image is what it is supposed to look like, and the third is what it ends up doing towards the end. It looks like the IK controls just forget to move forward and instead move up...? Would appreciate any thoughts on what is going on.
Here is my file if that is helpful: