Programmable matter is the idea behind creating a large number of very small robots that can reorganize themselves into different shapes. It was perhaps most famously depicted in the movie Big Hero 6, with the main character's Microbots:
There have been a bunch of attempts from different research groups to try to work towards this goal. One of my favorite are the Robot Pebbles from Gilpin and Rus, which are small cubes that have electropermanent magnets on their faces:
Probably the most advanced are the M-Blocks from the same research group at MIT, that use a series of internal fly wheels that they quickly break to generate motion:
Hackaday.io had an interesting attempt a number of years ago by Harry Svensson to make a fully-mechanical version of programmable matter:
I've been interested in this sort of "low resolution programmable matter" -- the idea of relatively large cubes that are (ideally) much easier to design and build -- for some years, but I've not really had any time to start experimenting in the area, and most of the ideas I tend to have seem like they'd have large technical hurdles to overcome. In this project, I make a first attempt using a somewhat ridiculous idea I had where each cube can essentially lift itself up overtop of neighbouring cubes by extending a large telescopic actuator from below, then sliding itself over:
I like the thought to begin with, but I was wondering why you are looking to telescope through the end of the box furthest from the actuator? I am guessing (based solely looking at your video) that you would find a better center of gravity if you have everything flipped.
Also you worry about getting enough height, I'm not sure if you can find a long enough linear actuator for the job, but perhaps you can build off this patent (Linearly moving extendable mechanism and robot arm equipped with linearly moving extendable mechanism). I remember someone 3d printing something similar, but I can't find the link and this is the closest I could find with the idea. I hope it helps!
https://patents.google.com/patent/EP2375104A1/en