Does all the serial data display correctly?
Try putting a delay before: client.disconnect(); I had a problem with a Nodemcu closing before the data was sent.
I also have a problem with my Nodemcu working intermittently but like you I am not sure why. It could be a problem with my Pi going to sleep. I need to trace the problem when I can work up the enthusiasm!