when I open a directory from a Flatpak app such as DropBox or Cryptomator, it opens it in Visual Studio Code instead of Dolphin. This doesn't happen if I open a directory from a non Flatpak app. Also
xdg-open ~ as expected opens Dolphin. So it seems to be a Flatpak issue.
Visual Studio Code is installed with apt, the official way to install it.
This other question seems similar: Flatpak applications use nautilus instead of Dolphin
I notice the same issue opening a directory from Chromium Browser installed as a Snap.
This is the issue I have opened on Github on the repo
I have upgraded my system to Kubuntu 22.04, the issue seems to be solved for Flatpak apps but still affects Snap apps.