Thats gimbal lock, apply a Euler filter to your animation, that should get rid of the locking but im not sure animating a rubicks cubeis technically possible with a Euler system. I did something symilar but its quite complex to set up.
FX supervisor - double negative