If this scenario applies, the only fix is to disable AP isolation. This security measure might be the culprit that prevents the involved devices from communicating with each other. AP Isolation is blocking the connection – Another possible reason why the LAN feature is not working on Minecraft is a feature called Access Point isolation.
Since we’re talking about a LAN connection, you will not see the other person if you aren’t on the same network. In this case, the solution is to configure your Firewall to allow the connection from and into Minecraft.