Then you could also do it at the surface. But they do it a depth because they want a pressure difference on the two sides of the osmosis membrane. You somehow need to generate that pressure difference and the energy you need for that is minimum equal to the amount you need to move the freshwater.
Oh, and you will have to do it continuously, not with a 'container'. Existing desalination plants produce hundreds of thousands of cubic meters of fresh water per day.
You pump water off the top of the pipe, reducing mass and pressure at the bottom and thus allowing for desalination. It's a classic distance x force trade off: it's easier to use a static membrane, and a low pressure pump then build a high pressure pump at the surface.
Nothing in this system is 100% efficient, so how you organize your components can make a huge difference.
You have had to spend energy to get the floating container to the bottom.
If you filled it with something heavier than water, or left it open to the elements to sink, you still would have to spend a bunch of energy to pump it clean at the bottom.
I think I see what you do not understand. Your freshwater is at surface pressure, not at depth pressure. You cannot just displace the salt water from your container, you need pressure to displace the saltwater and put the freshwater out of the filter chamber and in the container. That does not just happen because you cannot do it in the filter chamber as else, that filter chamber would lose its pressure differential and not work anymore. Sorry, but your idea is not made for reality :)
The idea is a perpetual motion machine (the water of the ocean is just part of the machine) and I’m trying to show OP that. They’re just skipping an energy intensive step in their heads with every idea.
It has that density when full of air? What about when it’s full of highly pressurized salt water?
Or, if it’s open to the environment on the way down, how does it evacuate the salt water and how much energy does that take?
Even if all this wasn’t a perpetual motion machine, which it is (the sea water is just part of the machine), wouldn’t it be easier to just float some solar panels to power a pump?