Out of the box a browser installed via Flatpak can't communicate with KeePassXC using the browser extension because of Flatpaks encapsulation.
This can be fixed by adjusting the browsers Flatpak permissions, adding a wrapper for keepassxc-proxy to the browsers container and spawning keepassxc-proxy from within the container.
I built a script that does this for you. Currently supports Firefox, Librewolf and Ungoogled Chromium.
Have fun!
I had a similar issue with firefox launched via firejail where I had to pass through the socket file it uses to communicate with.
If it helps anyone, this was my solution: