KWallet Secrets Portal can't get secret for Flatpak

I wanted to try out the XDG Desktop Portal secret functionality in Frameworks 6.2.0, so I tested it with Pika Backup from Flathub. However, attempts to save the encryption password fail, and eventually the following error message appears from KWallet:

There have been repeated failed attempts to gain access to a wallet. An application may be misbehaving.

I’m not sure if this is a bug or if there’s something I’m missing, so I thought I’d ask here first. I only have one wallet which, according to KWalletManager, is open when the error occurs. Is there anything else I should check for?

After some further testing, I felt it’d be best to submit a bug for this. The Secret Portal implementation generates a new secret every time it’s called, which means Flatpak applications will never have the right key to decrypt their secrets.

If anybody else is running into this issue, the bug report in question is here: 487348 – Secret Portal fails to store secret for Flatpak applications