Xbee series 2 drops off network without apparent cause - diagnostic suggestions?
After much fault finding, the thing that finally fixed this was putting the ATMega328P into "full swing" clock mode, which according to the datasheet is much more resistant to noise than the low power mode.

So the answer should probably be "Go back and read the datasheet.  No matter your problem, READ THE DATASHEET."