The strange behaviour you encountered is not actually a bug, but a misconception of how rotations work in the engine.
We represent all rotations as quaternions in the engine, a bit different than the more broadly known “euler rotations”. Just changing the Z-value of a quaternion can result in strange results if not fully aware what it means. There are great explanations online how quaternions work so I will not go into details here.
But a quick and short answer to how to solve it in your specific case:
rot = go.get_rotation()
local radians = math.pi / 180 * 10
rot = rot * vmath.quat_rotation_z(radians)
go.animate(".", "rotation", go.PLAYBACK_LOOP_FORWARD, rot, 1, 5, 0)
More info: vmath.quat_rotation_z()
(I have not tested this code myself, but I think it should work. ;))