ER_DBACCESS_DENIED_ERROR

The EVENT privilege is required to create, alter, drop, or see events for the Event Scheduler. This privilege was added in MySQL 5.1.6. The EVENT privilege has schema-level scope.
Check err after CREATE EVENT IF NOT EXISTS... If err.code is ER_DBACCESS_DENIED_ERROR, then use the nodeCleanup.