Macro error speach

I used to have a script I could put into a macro that stopped the “it’s not ready yet” “you have to get closer” etc notification when you used an ability and something wasn’t off cd. But my old script isn’t working anymore. Is there a way to remove this still?

Tried
/script UIErrorsFrame:Clear()
/use ability

and

/script UIErrorsFrame:hide()
/use ability
/script UIErrorsFrame:clear()
/script UIErrorsFrame:Show()

There should be an answer in here:
https://us.forums.blizzard.com/en/wow/t/disable-error-sound-in-macro