Coops already exist. Basically they’re already set up so that when people move in, they own part of it, and when they move out, they don’t. The technical legal details of it varies from your country, region, municipality, etc, but from my basic understanding, when you sign your contract, it includes saying “you own this building with us until you move out. We might ask you to move out if you poop in the communal garden.”
Edit: re-reading your post, I realize I’m not sure if you mean the entire building or a single unit, but either way you can have similar arrangements.
I mean, yeah