Apple suggests to use UNUserNotificationCenter instead of deprecated NSUserNotificationCenter.
I've played (on macOS 10.15) a bit with UNUserNotificationCenter and always getting the authorization error "Notifications are not allowed for this application".
Not sure, but it seems the root of this error is unsigned/unnotarized application.