Your program starts with a linear movement, which does not contain any information regarding the posture of the robot, so it chooses a default value.
You can go to Settings/Advanced and then look at the Start-/Endposition tab. Change the Initial Posture e.g. to 010 and it will move the more directly.
At the end, the robot is moving back to its position given in axis values. As you are winding up your A6 it will unwind.
You can right-click the robot component and set A6 to infinite, note that you also need to set that in the robot configuration. The settings in KUKA|prc will only affect the simulation.