Both the D-Bus method and the Main.wm you are calling still exist, but all gnome-shell D-Bus interfaces that are either private or only meant for debugging are now limited to expected callers unless the shell is put into “unsafe mode”.
You’ll need an extension that either
toggles global.context.unsafe_mode when enabled (not recommended, because allowing any app to inject random code into the compositor is — well — rather unsafe)
exposes an unrestricted SwitchApp() D-Bus method that your script can call instead of Eval()
implements the gesture you want so you don’t have to go through custom commands/D-Bus calls
Thank you for clarifying what is going on and for pointing me to extensions. I found an extension called Touchpad Gesture Improvements that is compatible with Gnome 41 and allows me to use the gestures I had previously set up.