I’m assuming the simplest scenario which is like a fairly small business started by a group of people around the same age so that we can assume they’ll all retire around the same time. If it’s difficult to make simple cases work then more complex ones are probably even more difficult.
I think there’s a big issue with getting the government involved: this group of people came together, built a company, paid for all the equipment themselves, and now want to sell it all so they can retire on the profits. Forcing them to transfer the company or its equipment to other people (who neither contributed anything nor have any money to pay compensation) would nullify their property rights. In essence, we’d be saying they never owned their company in the first place.
The ordinary way this issue is resolved today, with properties such as certain kinds of golf courses, is to have new members purchase their membership either from an existing member (transferring it to them) or from a pool of new memberships voted in by the existing members. This way the existing members are compensated for the arrival of new members and anyone who no longer wants a membership can sell theirs (possibly for a profit).
It’s hard to see how this would work with workers in a socialist system, unless the government was providing new workers with money to help them purchase their share of a company. But then the question is: how do you protect such a system from abuse, where people might take the money and run or otherwise waste it?
Lastly, I would point out that if you have a market system then you really can’t prevent people from buying and selling capital (such as machinery). After all, a machine is simply an assemblage of parts and people can definitely buy and sell parts (otherwise you don’t have a market whatsoever).
As an aside, you can actually go on eBay or Craigslist today and buy a used lathe or milling machine for a few thousand dollars and start making production-quality metal parts (such as car parts) if you have the know-how. Things are very different today from the days of Marx where factories and their equipment were rare and cost a king’s ransom. Of course a modern car manufacturing plant is going to cost billions of dollars today, but that’s due to all the custom robots they use to mass produce cars in a highly automated fashion. A skilled machinist can produce as good or better quality parts with machine tools from the 1960s.