That's a known issue, see https://forum.snapcraft.io/t/cannot-open-display-after-session-type-changed-wayland-x11/23838. The problem appears to be partly in gnome-session (https://gitlab.gnome.org/GNOME/gnome-session/-/issues/75), partly in the snapcraft desktop extensions that assume a wayland session if there's a lingering wayland socket (https://github.com/snapcore/snapcraft/blob/main/extensions/desktop/common/desktop-exports#L240).
It is not specific to the firefox snap, and it can be worked around by running the apps with DISABLE_WAYLAND=1.
That's a known issue, see https:/ /forum. snapcraft. io/t/cannot- open-display- after-session- type-changed- wayland- x11/23838. The problem appears to be partly in gnome-session (https:/ /gitlab. gnome.org/ GNOME/gnome- session/ -/issues/ 75), partly in the snapcraft desktop extensions that assume a wayland session if there's a lingering wayland socket (https:/ /github. com/snapcore/ snapcraft/ blob/main/ extensions/ desktop/ common/ desktop- exports# L240).
It is not specific to the firefox snap, and it can be worked around by running the apps with DISABLE_WAYLAND=1.