Switching display mode on X11 crashes Gnome

When I’m connected to an external display and I try to switch from extend to mirror, Gnome crashes and logs me out. This only happens on X11, not Wayland. How do I fix this?