OMG I can’t believe the solution is so simple: enable affected apps to run in the background.
It seems that for some apps KDE background portal are force-closing them, for whatever reason. Until this is fixed the solution is to install Flatseal and enable those apps to run in the background. It is stupid, I know, but it works.
There are other people with this issue too: Reddit - Dive into anything