We had a friend who would play Metal when the ice cream store he worked at was closed but the customers were lingering too long. It generally worked, as he was immune.
I introduced my local restaurant owner to Mongolian Techno and the late night bar flies and some of the kitchen staff have never forgiven me. He won't admit if he plays it for himself, or because of them :)
It's 3am and we're arguing some insipid minutae over technically illegal tequila shots while one drunk girl is breaking it down on the tiny dance floor :)
In Japan it's pretty much an institution that shops play an instrumental version of Hotaru no Hikari (which is basically Auld Lang Syne with different lyrics) when they're closing.
We did this where I bartended as well. Generally 15-20 minutes after serving the last drink of the night.
The goal wasn’t to offend or clear out 100% of the customers - just make a large enough portion decide that outside might be more comfortable/conducive than inside. The 20 or so customers who were fine with the cacophony were easy enough to wrangle manually, and also generally either people we knew well .
I was at a coffee shop once that was playing metal while my writing group was meeting there and I just thought they had excellent taste (it was not near closing time)