AppImage Can't Open Browser

I am trying to package this AppImage Application.
But I ran into an issue when running it with appimage-run.
The application is unable to open links in the browser, which is required to authenticate.
ChatGPT thinks that the issue lies with a missing xdg-open dependency and tried to add it with makeWrapper $out/bin/${pname} $out/bin/${pname} --prefix PATH : ${pkgs.xdg_utils}/bin
Which caused the application to stop working.

{ pkgs ? import <nixpkgs> { } }:
let
  version = "1.0.1";
  pname = "code-expert-sync";
  name = "${pname}-${version}";

  src = pkgs.fetchurl {
    url = "https://github.com/CodeExpertETH/CodeExpertSync/releases/download/v${version}/code-expert-sync_${version}_amd64.AppImage";
    hash = "sha256-zz222IqkxOjdnquGCZpRE1i6fzveMMRY3jbe3xfAoBs=";
  };

  appimageContents = pkgs.appimageTools.extractType1 { inherit name src; };
in
pkgs.appimageTools.wrapType1 {
  inherit name src;

  nativeBuildInputs = [ pkgs.buildPackages.makeWrapper ];

  extraInstallCommands = ''
    mv $out/bin/${name} $out/bin/${pname}
    # install -Dm755 ${appimageContents}/usr/bin/${pname} $out/bin/${pname}
    install -m 444 -D ${appimageContents}/${pname}.desktop -t $out/share/applications
    # substituteInPlace $out/share/applications/${pname}.desktop --replace-fail 'Exec=AppRun' 'Exec=${pname}' # not necessary already the case
    cp -r ${appimageContents}/usr/share/icons $out/share

    # makeWrapper $out/bin/${pname} $out/bin/${pname} \
    #   --prefix PATH : ${pkgs.xdg_utils}/bin
  '';

  meta = {
    description = "Code Expert Sync allows syncing projects to a local file system. This allows students and lecturers to edit code with their own IDE and create local backups.";
    homepage = "https://github.com/CodeExpertETH/CodeExpertSync";
    downloadPage = "https://github.com/CodeExpertETH/CodeExpertSync/releases/tag/v1.0.1";
    license = pkgs.lib.licenses.mit;
    sourceProvenance = with pkgs.lib.sourceTypes; [ binaryNativeCode ];
    maintainers = [ "me" ];
    platforms = [ "x86_64-linux" ];
  };
}

Are your xdg-portals set up correctly?

systemctl status --user xdg-desktop-portal

Try this: xdg.portal.xdgOpenUsePortal = true;

The xdg-desktop-portal service seems to be okay.
And explcetly enabling it did also not change anything.

systemctl status --user xdg-desktop-portal.service                                                       ✔  08:06:12  
● xdg-desktop-portal.service - Portal service
     Loaded: loaded (/etc/systemd/user/xdg-desktop-portal.service; linked-runtime; preset: ignored)
     Active: active (running) since Fri 2024-10-11 07:57:06 CEST; 9min ago
 Invocation: 42906c6570934eb4a2c1b22869162089
   Main PID: 4287 (.xdg-desktop-po)
      Tasks: 7 (limit: 9113)
     Memory: 2M (peak: 5.9M swap: 2.3M swap peak: 2.3M)
        CPU: 181ms
     CGroup: /user.slice/user-1000.slice/user@1000.service/session.slice/xdg-desktop-portal.service
             └─4287 /nix/store/sczai2gv7di38pg5c722n4zpaizy977y-xdg-desktop-portal-1.18.4/libexec/xdg-desktop-portal

Okt 11 07:57:05 nixos systemd[3344]: Starting Portal service...
Okt 11 07:57:06 nixos systemd[3344]: Started Portal service.