AJS.Confluence.PropertyPanel.Macro undefined

After upgrading from Confluence 7.13.2 to 8.5.2, some buttons related to macro property panel stopped working.

After analyzing the logs I’ve noticed this error:
Cannot read properties of undefined (reading ‘registerButtonHandler’)

I’m registering the handler for the macro property panel like this:

I wasn’t able to reproduce on my instance, as this is happening for a specific customer. Does anyone have an idea about the problem?