The developed countries don’t just face population stagnation, but rapid depopulation. This is happening today.
Given that robots cannot give birth to children today (or in the near future) and cannot go to war, I don’t see what is a viable option for those countries that want to close their borders today to protect their “purity”.
They don't face "rapid depopulation", they face moderate population decrease in the short term if immigration was to stop. Again, claiming that there is no alternative to mass immigration is trying to avoid short term pain for short term gain at the cost of the whole national future, and that's the most charitable interpretation that avoids theories that this is done on purpose.