I had the same issue when my pc was connected using both wifi and lan.
It worked if both the xbox and pc were only connected using wifi.
I am not sure why this actually fixed it but it might be related to the different subnets and ip addresses used on different networks?
As in a similar thread here, I also had the problem that the xbox would not show up at all on the pc if the xbox was connected using wifi and the pc was connected using lan.