attribute.getSelectedChannels() returns None if (as it looks like) there are no channels selected.
So then on line 949, it has the potential to attempt to iterate over None.
Since attribute.getSelectedChannels() is meant to return a list, if nothing is found, it should likely return  instead of None.
I don’t know if that explains why you encounter this bug because it still works in 2022 and you shouldn’t need to select channels. Changing that None line might just pave over a different bug. Possibly something changed in Maya 2023. I’m getting 2023 installed to test.