I have been forced to monkey patch the SDK. Xero team can contact me to get the Tenant ID that generates this error.
original_setter = contact.Contact.tax_number_type.fset
def patched_setter(self, tax_number_type):
"""Setter that handles malformed tax_number_type from Xero API."""
if tax_number_type and isinstance(tax_number_type, str) and "TAXNUMBERTYPE/" in tax_number_type:
tax_number_type = tax_number_type.replace("TAXNUMBERTYPE/", "")
original_setter(self, tax_number_type)