i have a really annoying problem with firefox on windows, in two parts:
when i select settings > appearance > system, it does not actually follow system, but is always set to dark. so i have to set it manually whenever i change system.
the theme that is used for the toolbar, etc. is also set separately and have to change that manually too.
Check both settings: in about:addons > Themes, select the system/automatic theme if your version offers it; then set Website appearance to System. A fixed Dark browser theme can keep websites dark even when their setting says System. On Windows, also check the app color mode, not just the Windows shell mode. If it still sticks, which Firefox version are you using? Mozilla's explanation.