The button triggers event customEvent
apex.event.trigger(document, 'customEvent', {});
Dynamic action listening to event customEvent has true action defined which initialize
the plugin with attribute Settings / Narrow to Affected Elements not checked.
In this case the plugin expects dynamic action data (this.data.element) to determine triggering element.
Event is triggered with data empty object. Property element is missing and in the result, the error is raised.