Would it be possible for something like this to work on MacOS? Or does it fall outside of what is possible given the system's "configurability"?

There's this, based on the PaperWM GNOME extension. https://github.com/mogenson/PaperWM.spoon