Looks like when a selected cluster have a site the script returns an error. I'm running Netbox 3.3.2 with Python 3.10. Maybe it is something related to the newer Netbox version.