However, socialism and open borders don’t mix well, because once you turn a society into a giant workers’ co-op, adding new members always comes at the expense of the current members.
Why should that be the case? Wealth and income of this giant worker’s co-op are not fixed, and why shouldn’t they scale with the number of members?
Your Richland-Poorland example is indeed illustrative, thanks. However, it seems the problem caused by immigration does not only occur when incomes in Richland were equalized before the immigration, but rather they also occur when people care about the degree of income inequality in their own country. So if Richlanders are free-market fans, but they do not like domestic inequality, they will want to keep the Poorlanders out.