Make sure both machines are on the exact same network.
One might be connecting to your 2.5GHz antenna, while the other is on the 5Ghz antenna, and some routers will block this (or not; it’s a setting in the router).
Can you confirm any other type of IP traffic between the two machines? (like RDP or ping)