Last time I looked at it on macOS, you had to disable keeping the TCP connections or something like in the network stack. Which incidentally disables Find My, sadly.