I find this problem in Ubuntu 22.10 - The overall "Style" is set to Dark. I set my legacy application theme to "Yaru bark dark" using Tweaks. If anytime later I open Settings > Appearance, the legacy theme is immediately changed to "Yaru bark" (the light version). That shouldn't happen.