I believe you’re having the same problem I’m having. This is a gimbal lock issue and I haven’t yet found a solution. I’ve been tasked with animating several moves on a rubik’s cube and certain (already rotated cubes) are taking a curved path.
Maybe this little explanation might help you more than me.
https://www.guerrillacg.org/home/3d-rigging/euler-rotations-explained
I’d be happy to find a solution. Been working on this for four weeks.