Sometimes the node-red web page is not connected

Sometimes the Nordred web page is not connected.
I am using it by connecting the sensor to Raspberry Pi 4b.
I am using node-red by running it automatically in an environment where there is no Internet. The webpage screen displays a screen that says Unable to connect.
What could be the problem?
First of all, it seems that the automatic execution works well when the Internet is connected.

Which webpage screen? The editor or the dashboard or another page?

Stop node red and run it again in a terminal. If you installed using the recommended script then you can do that using
node-red-stop
and check that node red has actually stopped, then run
node-red-start
and copy/paste the full output here.

Also look in the browser at the browser developer tools, refresh the page and see if any errors are shown.