the result of IsHDEnabled()
was initialized with true.
But in case of no keys or a blank hd wallet the iterator would be skipped and not set to false. What had resulted in a wrong return and subsequent false hd and watch only icon display in gui when reloading a wallet after closing.
.. PR has move to main repro https://github.com/bitcoin/bitcoin/pull/22781