This is because you are mixing "ZYX" (intrinsic rotations) with "zyx" (extrinsic rotations). Use the same format everywhere and you should get consistent results.