Is there any danger in swapping desktop environments, window managers, etc?

For mortals, using XMonad under KDE seems to require a little work. On NixOS, though, it looks like XMonad can be enabled with a single config line:

services.xserver.windowManager.xmonad.enable;

I’m imagining I would put that right next to these, which are already in my config file to enable KDE:

services.xserver.displayManager.sddm.enable = true;
services.xserver.desktopManager.plasma5.enable = true;

Will doing that in fact replace Plasma’s default KWin with XMonad? Is it really that easy, or should I expect conflicts to ensue?

Or suppose I went further, and switched to xfce + xmonad, and then switched back to kde. Should I expect all my KDE configurations (KDE requires a lot of manual config) to survive the trip?

While I don’t have an answer to your actual question, nixos-rebuild build-vm can give you a VM running your full configuration, which is how you could verify nothing breaks without changing your actual system first, despite the manual configuration.