Hey there!
Did you happen to clear Safari’s history? And try again?:
https://support.apple.com/guide/safari/clear-your-browsing-history-sfri47acf5d6/mac
Sometimes I think too many open tabs, and browsing cache may cause an error like this.
Also, as asked earlier, is this happening only on specific web sites? I guess the steps may differ depending on that answer.
There’s a few places I’d check in the Safari > Preferences:
First, I’d check for installed Extensions, if any, disable or uninstall, relaunch and test.
If happening on a specific web site:
https://support.apple.com/guide/safari/customize-settings-per-website-ibrw7f78f7fe/mac
Or on multiple websites:
https://support.apple.com/guide/safari/websites-ibrwe2159f50/14.0/mac/11.0
If happening on the specific web site, while there I’d click on Safari > Settings for this web site > Enable content blockers, if enabled/disable, if disabled/enabled, relaunch and test.
Likewise, beforehand a good test would be to open Safari in Private Mode and test:
File > Open a new private window.
Perhaps website cookies and cache are getting in the way, if the website isn’t working properly, this may tell you the answer.
Most likely, testing the same website(s) in another browser will yield different results, but is worth a try, this may tell you for sure if a website(s) isn’t working as it should, either that or is causing an issue with just Safari, whether it be a setting, plugin, cache issue, or even just a temporary problem. But your Mac usually won’t notify you unless there’s a real problem.
You can also utilize Activity Monitor to view stray processes while the issue occurs:
Activity Monitor User Guide:
https://support.apple.com/guide/activity-monitor/welcome/mac
If there is a specific tab/open website running a muck, there maybe a clue there. I’d probably focus on the Memory/CPU/Network tabs to see what’s going on.
There’s also a chance you may have malware installed that’s affecting the browser performance. If you’re not sure what to look for, and clearing the Extensions and history/restarting doesn’t do the job, I personally believe Malware Bytes for Mac is a good tool to use:
https://www.malwarebytes.com/mac/
Anyhow, hope some suggestion helps.