When you're in your visa or green card process it's not uncommon to be advised not to travel out of the country...
Yep. You're kind of in jail.
It doesn't mean that you cannot, it just means that it might complicate your already complicated application. So if a family member dies, maybe... But that's it
I've known people who left for a brief period during the GC process on emergency basis and then were put into a literal jail on their return to the USA.
This is true. But you might be conflating two different issues: having to apply for a greencard from outside the country, and being restricted in traveling outside the US during the (potentially very lengthy) pendency of that application.
No, I'm aware of the difference. I just wanted to write this down as 'being told you cannot do something' is not something the typical American likes. Yet, when going through immigration, it's common...