Confusion abounded at airports as immigration and customs officials struggled to interpret the new rules, with some legal residents who were in the air when the order was issued detained at airports upon arrival.