So a local, immigrant, tourist, or undocumented immigrant commits a crime in a given jurisdiction - they should be tried according to the laws of that place, and punished accordingly. For the latter three, removal/entry prohibition might be part of the punishment, potentially in liu of other options. For petty crime e.g. drunk and disorderly or whatever, that's probably fine? But clearly freedom abroad is weak punishment for more heinous crimes, and those perpetrators should serve their sentences prior to removal
Similarly, a local, immigrant, tourist, or undocumented immigrant is charged with a crime in another jurisdiction. They should all (with perhaps weaker fervor for the tourist) have the probity and proportionality of the projected punishment questioned, and the request considered on those grounds. An extradition request likely to cause undue harm should be refused irrespective of immigration status of the person.
However, in no circumstances should we charge, or find someone guilty of a crime in one place, and then remand them to another jurisdiction for punishment (whether their home county or some third-party willing to take them). Here lies the illiberal madness in which we find ourselves.
Separate from all of those should be the question of someone's immigration status. Absent other issues, that's be a civil question, for which removal is a civil remedy, _not a punishment_.