Snap not working after snap refresh

In our .yaml we redirect an absolute path to the added gnome extension. Something needs to use an absolute path that it does not find in the container, thats why we redirect it via layout and bind in the snapcraft.yaml It all works fine until you update the snap via snap refresh. Then the same error as before comes up:

** (Smart-SIP-Phone:71994): ERROR **: 10:37:17.223: Unable to spawn a new child process: Abspalten des Kindprozesses »/usr/lib/x86_64-linux-gnu/webkit2gtk-4.1/WebKitNetworkProcess« gescheitert (No such file or directory)
Trace/Breakpoint ausgelöst (Speicherabzug geschrieben)

We already tried to just import the missing lib files into our own snap via stage-packages, but it still does not find the file. The file still exists in the gnome extension as well, it just seems the layout-bind gets ignored or missing in the refresh process.

the following is our snapcraft.yaml:

name: smart-sip-phone # you probably want to 'snapcraft register <name>'
base: core24 # the base snap is the execution environment for this snap
version: '1.0.10' # just for humans, typically '1.2+git' or '1.3.2'
summary: Placeholder
description: Placeholder
grade: stable # must be 'stable' to release into candidate/stable channels
confinement: strict # use 'strict' once you have the right plugs and slots

layout: 
# Die festen Pfade von Alsa umleiten
  /usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/alsa-lib:
    bind: $SNAP/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/alsa-lib
  /usr/share/alsa:
    bind: $SNAP/usr/share/alsa
    # Pfad zur angelegten conf.d umleiten
  /etc/alsa/conf.d:
    bind: $SNAP/etc/alsa/conf.d
  # Den geforderten absoluten Pfad von WebKitNetworkProcess umleiten
  /usr/lib/x86_64-linux-gnu/webkit2gtk-4.1:
    bind: $SNAP/gnome-platform/usr/lib/x86_64-linux-gnu/webkit2gtk-4.1

apps:
  re-enable:
    command: hooks/re-enable.sh  # Dein ausführbares Skript
    daemon: simple  # Systemd startet den Dienst im Vordergrund
    restart-condition: always  # Neustart bei Absturz
    install-mode: enable  # Standardmäßig beim Installieren aktiviert
    plugs:
      - network  # Falls der Dienst Netzwerkzugriff benötigt
  smart-sip-phone:
    command: Smart-SIP-Phone
    desktop: usr/share/applications/smart-sip-phone.desktop
    plugs:
      - network
      - network-status
      - network-control
      - audio-playback
      - audio-record
#      - bluez  # sollte für Bluetooth devices sein funktionieren aber auch ohne ?
#      - removable-media
    extensions:
      - gnome
          
parts:
  alsa-config:
    plugin: dump
    source: alsa-config
    organize:
      conf.d/default.conf: etc/alsa/conf.d/default.conf
  program-icon:
    plugin: dump
    source: images
    source-type: local
    organize:
      Icon_org_rounded.svg: usr/share/icons/Icon_org_rounded.svg
  post-refresh:
    plugin: dump
    source: hooks
    source-type: local
    organize:
      post-refresh: meta/hooks/post-refresh
  my-part:
    source: .
    plugin: dump
    source-type: local
    organize:
      smart-sip-phone.desktop: usr/share/applications/smart-sip-phone.desktop
    stage-packages:
    # pulseaudio, da standardmäßig pipewird installiert
    # die utils für aplay, arecord und pactl Befehle
    # welche von Anwendung benutzt werden
      - pulseaudio
      - pulseaudio-utils
      - alsa-utils
      - libwebkit2gtk-4.1-0
    # Überschreibt das Standard building, muss mit snapcraftctl prime dieses nach dem Löschen wieder anstoßen
    # Wir löschen davor den toten Link
    override-build: |
      rm -f $SNAPCRAFT_PART_INSTALL/etc/pulse/client.conf.d/01-enable-autospawn.conf
      snapcraftctl build
      
hooks:
  post-refresh:
    plugs: [network, home]

Did anyone have a similiar problem or an idea what to try next ?

Edit: What i forgot to mention, when i run snap disable and snap enable after the snap refresh the snap works correctly again. Same goes for a system restart or when i completely remove and install the snap again.

Problem still persists, if anyone has any suggestions !

Sounds like a race condition to me, i.e. the layout being processed before the extension is mounted inside $SNAP/gnome-platform/ …

I’d open a snapd issue …