In that case it was an app or setting that was causing it. I hope the reboot and safe mode 'cleared' whatever process was acting up if it was random, but if it happens again, I'd try to pinpoint which apps you have installed that might interfere with display properties, like battery savers, 'night mode' viewers, etc.