But why did the Indian ocean territories ever have an ISO country code, they were never a country? It doesn't make sense that a territory should lose its TLD just cause it changes countries.
Couldn't they just move .io to a different category?
Specifically the issue is that two letter TLDs are reserved exclusively for countries/governments. So far only one exception has been made to this rule, .su for the Soviet Union. So another exemption is certainly possible.
It is weird to imagine a world in which glasnost kept the union together and we have active .su domains around. I imagine they'd be less suspicious than .ru in our timeline but not a lot less
2 Letter TLDs are always country codes (and ccTLDs are always 2 Letters long). So moving them to another category is technically possible, but unprecedented and improbable.