I have faced the same error on my local network in the past, I think it is a firewall issue on the host/server side. In my case to troubleshoot I used nmap.
The LAN game showed up in multiplayer as 10.0.0.21:49999. nmap reported that port from that IP as closed/filtered; so it is a firewall issue.
To confirm it is a firewall issue please turn off the firewall momentarily and see if you are able to connect while the firewall is disabled.
I followed above instructions and my issue got ressolved.