Have you set high microstepping using the M350 command in config.g? If so, set it back to x16 with interpolation for now. Homing the printer with high microstepping can cause the network to disconnect, because the processor is too busy generating step pulses and checking endstops to handle the network traffic quickly enough.