You are chaining a rotation after your straight path, so there is some interpolation, leading to the sway. If you use 2024, the only way to split the movement and avoid this would be to add a pause between the straight path and the rotation (pauses are made by creating two time the same keys)
in 2025.1 you can switch to media preview mode and edit the tangents