How to clear all notifications with 1 click 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