gnome – session crashes when unplugging USB-C hub with HDMI monitor

Ubuntu 21.04, Wayland Session on Gnome 3.38 via Mutter 3.38.4. Dell XPS 13 9300.

I have a USB-C hub which provides power, HID, and HDMI connectivity. Nine times out of ten, when I unplug this dongle, the screen goes black for a while and my user session is reset, presenting me with the login screen. When I log in again, all my open GUI programs have been killed (but background services are still running).

I believe this is due to Mutter (Wayland) crashing, but how can I prevent this?

Sometimes I will see a bunch of @@@@@@@ on a black terminal screen before the login screen is shown.

In Dmesg, I find the following:
(435887.627817) Call Trace:
(435887.627823) typec_altmode_update_active+0x60/0x100 (typec)
(435887.627834) ? cancel_work_sync+0x10/0x20
(435887.627842) typec_remove+0xee/0x110 (typec)
(435887.627853) __device_release_driver+0x181/0x240
(435887.627859) device_release_driver+0x29/0x40
(435887.627864) bus_remove_device+0xe1/0x150
(435887.627868) device_del+0x19c/0x3e0
(435887.627873) ? klist_put+0x23/0x90
(435887.627880) device_unregister+0x1b/0x60
(435887.627885) typec_unregister_altmode+0x30/0x40 (typec)
(435887.627896) ucsi_unregister_altmodes+0x46/0xa0 (typec_ucsi)
(435887.627902) ucsi_handle_connector_change+0x2d8/0x510 (typec_ucsi)
(435887.627910) process_one_work+0x220/0x3c0
(435887.627914) worker_thread+0x50/0x370
(435887.627918) kthread+0x12f/0x150
(435887.627923) ? process_one_work+0x3c0/0x3c0
(435887.627926) ? __kthread_bind_mask+0x70/0x70
(435887.627932) ret_from_fork+0x1f/0x30
(435887.627941) —( end trace b6d883829019f6e9 )—