Just FYI, you're describing socialism and there is a large body of theory that you can read about that discusses these ideas. It even takes into account the mistakes of the mid-20th century.
Here's a really nice introduction.
https://www.worldsocialism.org/spgb/pamphlets/capitalism-soc...