Flatpak is great for self contained apps, but it seems problematic when it has to reach outside the sandbox. I ran into this in VSCode and with CUDA video processing filters, but I'm sure there are more examples.
Try using Flatseal [1] which is a Flatpak app that helps manage permissions for other Flatpak apps. You can see exactly what permissions are enabled in each app's sandbox and expand/override everything from env vars to filesystem locations you want to enable access to.
Flatseal is only a convenience. I think you'll find that the flatpak CLI [1] has commands to do everything Flatseal does, albeit in an arguably unwieldy way.