How to clear all notifications with 1 click in Catalina? This question offers an AppleScript to clear all notifications within the Notification Center, but all of the answers seem to be pre-Catalina:

How do I clear All OS X notifications with 1 click?

Post-Catalina, with the same script I get an error (reported via Keyboard Maestro) that the Notification Centre cannot access the "close" property of its windows. Looking through some of the AppleScript dictionaries it seems like Notification Center has no windows at all (anymore?).

What would be the way to accomplish this in Catalina?
When scripting the user interface, for things like windows and menus the object hierarchy usually doesn't exist until it is shown, so the object needs to be shown before trying to get its properties.  Once the window or menu is shown, you can use the Accessibility Inspector tool (included in the Xcode bundle) or manually spelunk the various UI elements to find the ones you are looking for.  Interestingly, the Automator "Watch Me Do" action is also very handy for identifying specific UI elements (probably its best use), as the events it records can be copy/pasted into the Script Editor.

For the Notification Center window, the layout can vary, as individual notifications each have close/dismiss buttons, and there can also be an overall close/dismiss button for notifications grouped by application, although they aren't labeled as such.  Since the topmost button is conveniently located in the same place, to just close/dismiss everything a script can be used to click on that element until there are no more (tested in Mojave and Catalina):

tell application "System Events"
    # show notification window
    tell application process "SystemUIServer" to click menu bar item "Notification Center" of menu bar 1

    # loop through the app close buttons
    tell process "Notification Center" to try
        repeat -- forever (at least until there are no more)
            delay 0.25
            click UI element 2 of UI element 1 of row 2 of table 1 of scroll area 1 of window "Notification Center" -- the topmost close button
        end repeat
    on error errmess -- no more
        log errmess
    end try

    # close the window
    # tell application process "SystemUIServer" to click menu bar item "Notification Center" of menu bar 1
end tell