Ah... I overlooked your mention of safe mode in your original post. Sorry.
It's likely that reinstalling the OS will fix the problem, assuming it isn't caused by some other software that has been installed on the computer. If you have added anti-virus, cleaner or optimizing apps, or if you're running a VPN, it's possible one of those is causing the problem. If you are running any of these, try disabling them, restart and see if the problem persists.
If you do reinstall macOS, do only that. Do not reformat, erase, partition or otherwise change the structure of the startup drive. A simple reinstall of the OS will lay a fresh copy of all the OS files that are required, and will leave untouched all of your user files and data. You can do that from the macOS Utilities window that you get when you start the Mac in Recovery mode.
As always, it's a very good idea to make a fresh backup of your stuff before you do this.