The speech recognition system is designed to recognize speech, so if your microphone is picking up spoken commands, regardless of the source, the speech recognition engine is going to process them.
It does seem strange that the Quest 2 has apparently been designed in such a manner that the speaker output gets picked up by the built-in microphone.
I personally have no experience with that device (I have a Rift CV1, which does not have this issue), however a quick search engine query does suggest this can be an issue in multiple applications.
If it is not feasible to switch to a different audio solution (it appears there are both closed over-ear headphones and in-ear earbuds available from third-party manufacturers) that would not "leak" sound like the built-in speakers, you could consider using push-to-talk for VoiceAttack itself, assuming you have a button on your physical controls available.
Ideally you would combine that with push-to-deafen for Discord, so that its sound output stops while your are issuing commands.