You can actually do it with a GUI if you have Google Workspaces Enterprise using the Security Investigation Tool
Much like "crossing the streams" in Ghostbusters you can also do it with a documented series of commands GAM. Be very very careful with this as an improperly formatted command would likely result in all life as you know it stopping instantaneously and every molecule in your body exploding at the speed of light, or at the very least A LOT of deleted emails by mistake.
gam user <who> delete|trash|untrash messages|threads query <gmail search> [doit] [maxto<action> <number>]
gam group facultystaff delete messages query "Subject: Fwd: bla bla bla" doit maxtomodify 5
gam user [email protected] delete messages query "Subject: very secret documents" doit maxtomodify 5
gam all users delete messages query "rfc822msgid:CAD+g0[email protected]>" doit