This clever device moves heavy rocks upwards against gravity using buoyancy. Where is 'the work' coming from to move the rocks upwards?

So I saw this machine whilst researching the pyramids, and I've become completely fascinated by it. It seems to beautifully demonstrate many of the conundrums of work done, but remains alluring enough to appear to be magic.

I had remembered thinking of a similar machine to this as a teenager, and pondering why the principle of it wouldn't work. There's lots to discuss here, but I'll start off the thinking with the simplest question; When the boy puts the bubble-wrapped rock into the bottom chamber, he does so with relative ease because the rock is only just buoyant. Once its trapped in the upwards pointing chamber, it continues to move upwards until it finds a resting point in the top chamber. At this point - work has been done has it not? The rock now contains a larger energy potential than it contained before the boy pushed it into the chamber - so my question is, from where does this increase in energy potential come from?

Some thinking: The chamber is pressurised in a way that's not entirely stable. If you watch the full video he initially demonstrates the principle with a pint glass which is sealed at one end, creating a vacuum which stops the water rushing outwards. In the main demonstration, there's something similar going on. For gravity to pull all the water downwards, it would have to pull the additional top chamber of water with it. You can imagine that if the tube chamber was instead exposed to 'air', instead of being exposed midway into the top chamber, the water in the tube would rush downwards and empty itself out. This is why he has valves to control the pressure which he must open and close. Its not clear how much water is 'equalising' each time those valves open and close.

The best I can come up with is that the difference in pressure in the water - ie. the work that was done to initially fill the machine up with water - is the source of energy used to pull the rocks upwards. Over time, as he adjusts the pressure valves again and again, the water will flow downwards from the top chamber rendering the pressure difference/potential difference as equal again. This should mean that in theory he should not be able to get as much work 'out' transporting rocks UPWARDS than the total work done putting the water into the system? He's exchanging the cost of moving water UP a system for the cost of moving rocks UP a system? Arguably, the latter is more convenient than moving impossibly large rocks, as you can break the problem down into smaller units of work.

However, I'm not at all satisfied with this explanation, and I'd like to see more how this works in practise as well as theoretically. Is there a configuration in which the pressure equalises in both chambers over a difference in height - ie, is there a stable configuration of a device like this? One that 'remains' in that state no matter how many rocks transport up the tube?

The thinking I did about this actually led me to this problem which has some similarities regarding pressure. However in this example, the pressure issue is somewhat mediated by the weight of the rock making it 'just buoyant enough' and the fact that the pressure is mediated by a valve....but still, it seems such a beautiful demonstration that my intuition pangs into action telling me something stranger is going on than meets the eye.

To expand on the idea

In the below image, we can see a nice way of imagining the problem. The bottom chamber, in the area between the first gate and second gate, there's a volume of water. Lets imagine instead of being horizontal, it's slightly pointed 'upwards' to prompt movement from anything in there. With the second gate closed, we fill up the chamber with buoyant rocks until we cannot get any more in there. We then close the first gate and open the second gate. The rocks start to 'float' upwards, and some of the water 'equalised' into the bottom chamber. Is the work we can get out of those particular rocks equal to the work required to pump one exact chamber of water up to the top chamber?

Consider a symmetric seesaw with a heavy rock of mass $$m$$ on one end, and an identical rock on the other end. Because the seesaw is balanced, you can get one rock to steadily move up by giving it the slightest impulse. Clearly, the seesaw needs to do substantial work on the rising rock, so where does the energy come from? It comes from the falling rock, which does an opposite amount of work on the seesaw. To explain this another way, if you just focus on the rocks, gravitational potential energy $$mgh$$ is simply being transferred from one rock to another.

When a neutrally buoyant object goes up in water, precisely the same thing happens, because an equal mass of water goes down the same distance.

For example, consider a cylinder of area $$A$$ and height $$2h$$, where the bottom half of the cylinder is occupied by neutrally buoyant rocks, and the top half is occupied by water, where both the rocks and water have density $$\rho$$. If you start sending the rocks up, then eventually, the rocks will fill the top half and the water will fill the bottom half. The increase in energy of the rocks is $$W = (\text{Force}) \cdot (\text{distance}) = (\rho g A h) h.$$ But the exact same calculation shows that this is precisely equal to the decrease in energy of the water. We're just transferring gravitational potential energy from one object to another. There is no free energy, because the center of mass of the whole setup has stayed in the exact same place.

Of course, the ultimate source of the gravitational potential energy of the water could be a pump, or a human being. Or the water could have arrived at the top by precipitation, in which case the ultimate source of energy is the Sun.