there are several posts about the unexpected behavior of entity.setLocalEulerAngles,
but to me it’s still unclear how to set the local rotation of an entity in regular degrees and returning the same values when using entity.getLocalEulerAngles.
Euler angles are not stored in the entity directly but instead applied to the transformation matrix.
GetEulerAngles actually calculates the X Y Z angles from the matrix. However, since a rotation can be represented in a number of different X Y Z Euler angles rotations, what was set earlier may not be the same as what you get out again.
If you need to work in Euler angles, it is recommended that you keep track of them yourself in a script.