.an (Netherlands Antilles) is being phased out [1]:
The .AN top-level domain for the Netherlands Antilles is no longer eligible for
continued delegation, as it is no longer an ISO 3166-1 two-letter code. In
accordance with the code’s removal from the ISO 3166-1 standard, the ISO 3166
Maintenance Agency asks users of the standard to “stop using [the code] ASAP”†.
As discussed in detail in the consideration of a similar case of the .YU
top-level domain, ICANN’s role is to be an independent technical coordinator of
the domain name system. As such, the ISO 3166-1 standard was chosen as the
arbiter for what is, and what is not, a basis for country-code domains. In order
to retain consistency with the standard, ICANN coordinates the removal of the
.AN domain in conjunction with the transition to its successor domains. In such
cases, ICANN asks the current operator to perform an orderly wind-down and
transition process.
The proposed sponsoring organisation for .CW intends to continue to operate the
.AN domain while transitional arrangements are executed. These transitional
arrangements include provisions for registrants in Curaçao to transfer
registrations to .CW; and for registrants in Sint Maarten to transfer
registrations to .SX. The applicant calls for a phased transition to be
concluded over a period of three years, after which time the .AN domain will be
fully retired.
Not strictly speaking; it hasn't happened often enough for a policy to be established. The ccTLDs .cs (Czechoslovakia), .dd (East Germany), .yu (Yugoslavia), and .zr (Zaire) were all dissolved some time after the reorganization/renaming of their countries. However, this hasn't always been the case. For instance, .su (Soviet Union) continues to be used today.