You could have a 3x9 matrix, and envision folding it up into a 3x3x3 cube mechanically, and still keep the 3x9 wiring going.
Still uses the same number of pins.
Physically, I don't have a need for a cube of buttons, and think it would be awkward to use, having to move you hand in and out of the cube to transition between layers. Maybe you have something else in mind.