Error sending data from ESP

I suspect it is something to do with declaring the size of the variable to handle the Json string.
I doubt if the problem is at the Node-RED end as you say it correctly receives a message of 5 lines.

One of my IoT students had a similar problem last week.
Here's a link to the thread on the forum and the Arduino code we created and used successfuly.
We used these Arduino libraries...

PubSubClient
ArduinoJson

Note:
My student's requirement was 'subscribing' to MQTT messages. I'm sure the Arduino sketch can be extended or modified to handle 'publishing' MQTT messages.