I don't know the exact problem but have have noticed that whenever router(with dhcp) starts after the home assistant.
HA doesn't get's an IP and thus it's not accessible ever after waiting for 5-10min.
Also, that it not always the case sometimes it works(and I don't know how).