UI Scripting - macOS Big Sur Notification Center

I was able to solve the problem for myself @ajanian
I found out that the cursor needs to be over the notification for the Uli script to work properly. Take a look at the video here:

Clear Notifications in Big Sur