A similar thing happened to 91 Cuban refugees that were in transit to the US when Obama ended the policy of granting residency to any who reached the US.
There's a big difference between the current situation and the one you point out: the current immigrants were known in advance and traveling legally between their home country and ours. The Cubans were not known until they arrived. That is, Obama had no way to know they were in transit. Trump could have known he was stranding people, had he asked and if the INS has the data accessible.
The difference isn't that big. It had been US policy for decades to grant residency to Cuban refugees. Obama could have made the change effective as of a date a couple months in the future to avoid stranding those in transit but he chose instead to make it effective immediately.
That's terrible, Trump should reverse Obama's mistake immediately and give those Cubans green cards! I'm sure Trump would hate for refugees to be unnecessarily locked out of the US ... oh wait.