To sum up:1. Flatpak adds itself to XDG_DATA_DIRS (via /etc/profile.d/flatpak.sh) on Debian. Flatpak installations have precedence as default. 2. Currently, based on .desktop files, there is not even a sane way to support different versions in desktop shells. Gnome-shell is currently not planning to support it.
What remains would be to have an option to configure the flatpak precedence in a nice and clean way.

