[bug] "You do not have enough permissions to access this resource"

I have been facing this issue for a while on localhosted server. i am not sure whats the issue is. it works file on my local LAN network but this error starts when i shift the server on public IP. and this error occurs every minute even on the home page or in idle condition. first i checked changing the IP pool, disabling antivirus and firewall but nothing worked for me. it only works fine on internal LAN network.

ERP version is

ERPNext: v12.2.2 (version-12)

Frappe Framework: v12.0.20 (version-12)