What happens when an aircraft type is grounded while in flight?
The FAA is currently dealing with that on the 737 MAX.  They are allowing any airborne 737 MAX to continue to its destination or to an alternat or emergency landing site at the discretion of the crew  within the US thence flight ops are prohibited. Special airworthiness certificates and ferry flight permits may be issued by the FAA for moving the aircraft to a home base or maintenance depot as the discretion of the Administrator.