Network – How to prevent the machine from recognizing itself at startup

The name of my iMac is click on the window. Each time I restart it, for some reason, it detects that the name click on the window is already in use on the network and renames itself with a random suffix, for example, window click (3829) or similar, and get a zeroconf / bonjour hostname from windowlick-2.local instead of the usual windowlick.local.

I can fix this manually by going to the Sharing preferences panel, but I prefer not to have to, especially since I often do remote access from an external network (via ssh to another machine that receives the incoming port assignment) and if my machine it was restarted due to a power outage or system update. I do not like having to guess the host name.

My computer obtains its IP address through the router's DHCP assignment (a recent Netgear); It also behaved this way on my previous router (an Apple Time Capsule). It has a reserved IP address for its wired Ethernet port, but it connects via Ethernet and Wi-Fi. I suspect that something related to naming is noting an mDNS response stored in cache somewhere (like something stored in my router) for the old name and that is what causes the machine to change its name.

Is there any way to tell macOS that it is not "polite" and change its name if it sees "another" machine with the same name?

This seems similar to the computer name of My Mac mini changes continuously when it resumes from sleep mode, but I do not have the problem when resuming the suspension, it is only done after a reboot and I already have the static IP assignment according to the accepted answer in that question. Also, this does not happen on my MacBook (it does not have a static assignment).