MacOS can do this, it is called stage manager.
https://support.apple.com/en-us/HT213315
I tried it, but it is just not there yet. My use case is switching between 3d cad design and printing apps (browser, slicer, notes) and between coding (jetbrains ide’s, terminal, browser, draw.io app)