Usual reason I've encountered for that arising on current versions of macOS is a loop somewhere in the local network topology; where the problematic system can "see" itself via additional network paths. That's usually an incorrectly-configured network such as some wired and Wi-Fi connections, or multiple local network connections.
What's the local network configuration look like? Routers, switches, Wi-Fi devices, wired connections, etc. If there's both wired and wireless, then that usually either needs to be reconfigured into separate IP subnets with an intervening router, or the Wi-Fi device(s) should be switched to its access point mode (if the Wi-Fi device supports that).
I've also occasionally seen this misbehavior with the Bonjour sleep proxies in years past, but whatever was wrong with that was seemingly fixed in some of the now-older Airport and Time Capsule firmware updates.