Some Flatpaks fail to launch from launcher icon

I am running NixOS 22.05 with GNOME, I have Flatpaks enabled and many of them work as expected, but several of them will not launch when clicking their application icon in the launcher.
Some examples of a Flatpaks that I can’t launch from the DE are GNOME Boxes, GNOME Builder, Paper, Fragments, Fractal, and Polari. I see the following output in the logs when clicking their icons:

Aug 07 10:22:33 nixos dbus-daemon[1938]: [session uid=1000 pid=1938] Activating service name='org.gnome.Boxes' requested by ':1.11' (uid=1000 pid=1987 comm="/nix/store/v58j6aqsfdvpa4mffrlm6hrsgl1qs1ps-gnome-" label="kernel")

Aug 07 10:22:33 nixos dbus-daemon[1938]: [session uid=1000 pid=1938] Activated service 'org.gnome.Boxes' failed: Failed to execute program org.gnome.Boxes: No such file or directory

They all run perfectly fine from the command line using flatpak run. So far, I have only experienced this problem with GTK apps, but not all GTK apps have this issue.
I have also tried switching to the unstable nix channel and also tried Pantheon and KDE Plasma, although none of those changes had any impact. I can also confirm that the Flatpaks don’t have this problem on other distros.
Are there any possible ways to fix this?

I can attest having noticed the same problem (on both 22.05 and unstable), where should i report ?

I have not done much testing since writing this post, but I believe this issue on GitHub is what we are experiencing.

I think you’re right. I’ll test the patch to flatpak.nix from the issue.

Hosted by Flying Circus.