Back before session managers and desktop environments like Gnome and KDE, it was possible to swap out the running window manager. Sway you were switching from twm to blackbox, you could run
killall twm && blackbox to kill off the old and without terminating the session, launch a new one.
These days with the complexity and layers going on, I don't think that is practical to do. In fact I wouldn't bother trying, you will just end up with a messy environment.
Instead if you if you frequently need access to the full environment provided by each (say for testing software) look into the fact that you can run more than one X server at once. You could get one going and login to Gnome on console 7 and have another full blown X server on console 8 with KDE, and switch back and forth on a wim with Ctrl+Alt+F7.
Another suggestion would be to run a Xephyr server which will basically allow you to run a second whole desktop environment inside a window of the first.