QT applications does not start in dark mode when lauched from .config/autostart in Gnome

I want KeepassXC to launch in dark mode on startup. Currently, I solve launch on startup by checking the box in KeepassXC which places a desktop file in ~/.config/autostart/. As I understand it, this file is then started on boot according to the xdg-standard by the Gnome session manager. The problem is that it is started in a light color theme mode and not in dark mode as I want. If I kill that instance off KeepassXC and instead start it from the terminal, it starts with a dark mode, which is exactly what I want.

I believe the reason that it start with a darkmode from the terminal is that I have set this in my config

qt.platformTheme = "gtk2";
qt.style = "gtk2";

which from my understanding sets the environment variables $QT_STYLE_OVERRIDE and $QT_QPA_PLATFORMTHEME to “gtk2” which should make qt applications emulate the look of the current GTK theme. And since my GTK them is dark, them my QT theme should also be dark.

The issue seems to be that these variables are not set during the starting of .config/autostart which I have confirmed by creating my own desktop file there and printing all the environmental variables.

So from this it seems to me like there is a bug in how variables are propagated to the Gnome session manager during startup. Or have I missed something trivial?