See if the problem still happens in Safe mode. It can take much longer to safe boot (5 min) so be patient.
How to use safe mode on your Mac - Apple Support
Safe mode will often correct weird software behavior by forcing the OS to do disk repair, clear caches and other housekeeping and disables third-party mods and acceleration. When you're in safe boot, the machine won’t be at its best performance, especially with graphics, but that's expected.
Does the problem persist while in Safe mode?
Exit safe mode by restarting your Mac normally and evaluate the issue again.
Reboot your Mac in Recovery mode, use Disk Utility to run the First Aid routines on the drive and see if that will identify and fix any problems. How to repair a Mac disk with Disk Utility - Apple Support
Consider reinstalling macOS. This does not have to be destructive to any of your saved data. Just don't erase or reformat your drive. How to reinstall macOS - Apple Support