I not sure if you resolved this? There could be many explanations. But I have observed and recorded some behavior with AppleTV Gen 4, which while the symptoms are a little different to yours, could be related to the same thing. I have observed the Apple TV gen 4 sending packets (gratuitous ARPs for addresses it does not own) which could result in other devices see the AppleTV taking control of IP addresses which it does not own. If your AppleTV is doing a similar thing for your iMac IP address, this could definitely cause the symptoms you are seeing.
I have documented this at :-
https://discussions.apple.com/thread/7455927
It is likely that the issue is caused by a very specific combination of things (rather than just 1 trigger), which means it is likely a lot of people will not be affected. But it is also likely that different combinations of things could trigger the issue. In my case I believe it is triggered by combination of Gen 4 Appl3e TV + other AppleTV + Enterprise Cisco Wireless which guards against potentially dangerous network packets. But due to the nature of the Gen 4 AppleTV gratuitous ARP, it is quite likely this could cause issues in all sorts of different environments.
I will continue to chase a solution on that thread.