> I don’t think the government did anything wrong.
I think that rather depends on whether you regard the role of government here to assist its (future) citizens, or censure them (narrowly avoiding arrest and detention in this case) for what appear to be minor violations of immigration law.