Have you done any hacking around on preferences? Is the a sandbox build?
In either case, you should always do:
if the preferences system seems flaky or if you have hacked around on things. See if that clears it up. Restarting would effectively do the same thing too.
I quite the app and then used ActivityMonitor and 'ForceQuit' the 'root' instance and the instance running on the user account.
Re-ran the app and no more of the errors described above. Cool
Have you found our what was the cause of the problem?
It happens to me now, all the time, when I run (debug) from Xcode, my App which is like yours - a simplistic Cocoa app (Document based) with no "extensions" or "groups" or whatever.
It is, though, a sandboxed app (I set up the checkboxes to the best of my understanding, and archive it without diffuculty) but now I get these errors:
2019-09-07 19:49:09.598967+0300 PlanktoMetrix-II[84292:22916507] [User Defaults] Couldn't read values in CFPrefsPlistSource<0x6000000eab80> (Domain: com.apple.PowerManagement, User: kCFPreferencesAnyUser, ByHost: Yes, Container: (null), Contents Need Refresh: Yes): accessing preferences outside an application's container requires user-preference-read or file-read-data sandbox access, detaching from cfprefsd
and I'm wondering what I have done to cause this. My app Does register a set of defaults from a plist resource I have in the app once, upon launch - but that's all. And as much as I can see - nothing related to PowerManagement.