For example, if you are an illegal alien in Mexico you are deported if you are lucky. If you return after being deported, you get a ten year prison term.
I agree.
There would be dire consequences for illegal "entry" in some countries. In most countries, it's immediate deportation with no courts, back on the carrier on which you just arrived.