Task switcher during drag-and-drop causes Mutter to close the client connection
When showing the task switcher during a drag-and-drop operation (so after the drag start, before the drag end), the Wayland connection of the client that's the target of the drag-and-drop closes. The Wayland server hits this condition: https://gitlab.freedesktop.org/wayland/wayland/-/blob/0aebb5b94d6c9ba5e5b1440cb57060d9063e202d/src/wayland-server.c#L446-449
Here's an issue I made in the gnome-terminal repo which shows how to reproduce it by drag-and-dropping from a Nautilus window to a gnome-terminal window: gnome-terminal#352 (closed)
When the connection closes, GDK responds by unconditionally calling exit(0)
(https://gitlab.gnome.org/GNOME/gtk/-/blob/23af39b5b4bbbedb544593a95bae8710b8eaa377/gdk/wayland/gdkeventsource.c#L115-116), so there's nothing a GDK-based application can do to handle the situation.
I don't know if this is a bug in Mutter or if it's a bug in GDK (say, if it does something so strange that closing the connection is warranted). I was unable to reproduce with a drag-and-drop from one Dolphin window to another Dolphin window. I was also unable to reproduce with a drag-and-drop from a Nautilus window to a Konsole window, but only because Konsole refused to accept the dragged file after an alt+tab (even though it supports drag-and-drop just fine when no alt+tab is involved).