For example doing the following on a Touch Bar button with either "Run Apple Script" action selected:
display notification "My Notification" with title "Title" subtitle "Subtitle"
The notification does not show, but the rest of my Apple Script script works as expected.
display notification command:
- macOS Big Sur 11.5.2 (20G95) (latest as of this post)
- BetterTouchTool 3.581 (1724) (latest as of this post)