H-1B is a disaster and all its advocates anti-American.
But one could say little more in defense of a tech worker that trains their foreign replacement.
Just say no and go about finding something else.
Not so easy when you don't know when the next paycheck will be coming.
Usually you forgo a severance if you do that.