Rigging a Rubix’s cube is very complicated.
I’ve never had to do it, but I think Parker is right.
The easiest way to “get it done”, is not to have a rig, just animate the objects. (in Quaternion mode because Gimbal lock is highly likely). But make sure each object’s origin is actually in the centre of the “Rubix’s Cube”.
I might be imagining things, but did I see a Rubix’s Cube with “Geo Nodes” recently? I could have imagined it haha.
Maybe it would be possible?? But you might end up having to animate the vector values on nodes.
Every solution I can think of requires some kind of python scripting to dynamically transform the correct objects in the correct way.