I started a new post about this issue
https://colorlibsupport.com/t/color-of-header-and-menu-changes-after-clicking-on-it/
The solution was to do as you wrote. I also had the same problem for the site title so remember to change that as well if it is the same on your page.