You have connectivity issues at home that we can’t diagnose for you. Either your workstation or laptop is becoming disconnected from the Wi-Fi or it remains connected but the signal is poor or there’s a lot of interference — or that’s happening to your home assistant machine. When you experience these problems, try pinging the IP address, or that host name that you’re using, to see if there’s ping dropouts or you get ping responses. If the home assistant machine responds to ping, but it still won’t answer your browser’s requests, then it’s not a networking issue, but rather some software issue with home assistant.
99% of the time, it’s an issue with the network. Ask me how I know.
I agree with rudd-o on the cause of the problem, but when connecting both with IP or homeassistant.local then remember to add :8123 or your browser will try :80 or :443 by default and fail.