Wrong colors with GTK and flatpak apps

I’ve installed Gnome some days ago and then uninstalled it because I prefer Plasma over Gnome, but now everything related to Flatpaks and GTK apps is broken, especially with the xdg platform package.

How can I fix this?

Update: I don’t know what happened, but GTK apps now are in dark mode correctly. Only Flatpak apps are the only ones that look like the screenshot