That is what resident would signify. Not only residents are allowed in the country, plenty others are, but they have no right to be here, any more than I would as a tourist to any other country.
That depends in what sense you're using the word "right", but its ultimately immaterial to the point. Substitute "not only residents are
allowed to be in the country". And not only residents are extended protections against arbitrary punishment, notice, right to challenge etc.
The point is the same. They were allowed to be here. They were given legal permission. They committed no infraction. Their status was revoked without notice, they were sent to prison, and given no chance to challenge.
As i pointed out earlier, you're not even disputing that this happened, you don't give a shit that people who did nothing wrong were sent to prison on your government's dime-- and not by accident. You're just insisting on the government's legal right to treat people like this anyway, innocent or not. What does that say about your principle?