Rotate on Command

I didn’t mean the colors of the sides.

I was referring to your sentence:

I still do not understand why the box keeps reappearing in its original position.

That’s because when you have rotation by certain amounts, after 90 degree rotation they are the same angle. See my example where I avoid that.