Ahh a Rubik’s cube, depending on the axis of rotation and the changed position of the a single cube then the cube’s pivot or parent will need to change. Tricky.
Search the forum for Rubik and check out the various suggestions as other have had a go at building a Rubik’s cube.
I simplified the example by using a 2x2x2 cube. Somehow it seems as if the parts of the rubiks cube are rotated an additional time. I don’t know what is causing this behaviour
You can also try looking at how I handled the rotating on this demo using parenting. I tried to look and see where you were getting stuck but TBH that part got pretty harry to get right. But OTOH since I wrote the code in that one it should be relatively easy to answer questions about it if you have any. GL!