Rotation axis jumping from 0 to 180 even when rigid body is locked

I am writing a script that spins an object with a light attached to create a Day-Night cycle. Here is the bit of code.

void Update () {
        xrotation = xrotation + (Time.deltaTime / timescale);
        transform.eulerAngles = new Vector3(xrotation, 0, 0);
	}

When I set the timescale to 4 and it gets to 90 it continues up as it should but for some reason when the timescale is 1 as soon as it gets near 90 the number jumps up 1-2 degrees (despite the object rotation showing no visual jump) and then after passing that moment it starts going backwards and the y z elements change to 180. Not sure what the glitch is since it was working fine before, is there something wrong with my code? I got the eulerAngles from googling how to rotate objects while locking axis and I thought this was the line you were supposed to use.

Update I did more experimenting with it and I found that after it changes to 180 it the X goes in reverse until hitting 0 where Y and Z revert to 0 and X becomes 359. I don’t understand what bug this is but it is frustrating to eliminate. I even attached a Rigid body to the object and the values still changed.

Try this instead:

void Update () {        
     transform.rotation += Quaternion.Euler((Time.deltaTime / timescale), 0, 0);
 }

Instead of setting it explicitly, add to the current rotation the object has.