How to completely disable the sound effect at all for an invalid action?
You can set alerts to a different output, i.e. Internal Speakers, and/or turn the Alert volume: down completely.

System Preferences > Sound > Sound Effects