Depends on the system and country.
Over here in Poland, I've had or witness several encounters with "artificial intelligence assistants" over the past ~5 years[0], that would ignore you hitting 0, and respond to "talk to an agent" with some variant of "I understand you want to talk to an agent, but before I connect you, perhaps there is something I could help you with?", repeatedly. Swearing, or at least getting recognizably annoyed, tends to eventually cut through that.
--
[0] - Also, annoyingly, for the past 2 years we had cheap LLMs that would be better to handle this than whatever shit they still deploy. Even today, hooking up ChatGPT to the phone line would yield infinitely more helpful bot than whatever garbage they're still deploying. Alas, the bots aren't meant to be helpful.
So I have become accustomed to feeding it gibberish. I will type-in or recite nonsense numbers. It always takes 3 tries, 3 identical failures, before it routes me to a human anyways (the gatekeeping is simply an attempt at automatic authentication before the manual, human auth kicks in.) The most efficient way to get beyond that gatekeeping is by triggering unambiguous failures to authenticate.
And it is kind of funny; I don't know what is supplied to the humans' screens, but they are sometimes perplexed when they receive my call and I've just finished spouting gibberish to their ignorant robot bitch.
It usually just works to hit 0 (maybe more than once) or say "talk to an agent," even if those aren't options you're explicitly given.
Detecting swears just seems over-compliated.