An alternative suggestion.
Get BetterTouchTool, or similar utility https://folivora.ai/
With BTT, I can create a trigger (mouse, trackpad, keyboard, key sequence,...), for example Command-Shift-Control-Option-Right_Arrow and configure it to move the current window to the Space that is "Right" of the current Space. And Commnad-Shift-Control-Option-Left_Arrow to move the current window to the Space that is "Left" of the current Space.
I choose long multiple modifier keys because I did not want to accidentally conflict with any other keyboard shortcuts while testing, but I could have done some homework and selected something less difficult to press.
BTT triggers can be for the keyboard, the mouse, the trackpad, unique key sequences, etc...
BTT has a gazillion configuration options. It may have something for a hot corner, or even dragging to an edge, except I think the edges are reserved for window snapping, so that may not be a BTT option.
Or maybe a utility such as Keyboard Maestro https://www.keyboardmaestro.com/main/
Or some other keyboard enhancement utility.