I would probably use a lookup object for the messages and an array for the errors and a trigger node to send no errors.
Have a look at this, set the full messages and errors in the set messages change node. You would only need to set one mqtt node.
[{"id":"1e0c01ec4dea7859","type":"inject","z":"d1395164b4eec73e","name":"Test no errors","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"^D03900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1c�","payloadType":"str","x":170,"y":20,"wires":[["d2a6f2715590216e"]]},{"id":"d2a6f2715590216e","type":"change","z":"d1395164b4eec73e","name":"clean incoming string","rules":[{"t":"change","p":"payload","pt":"msg","from":"^D039","fromt":"str","to":"","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":".1c�","fromt":"str","to":"","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":400,"y":60,"wires":[["3f2f05ca372767b6"]]},{"id":"d78489fa01061f79","type":"inject","z":"d1395164b4eec73e","name":"Test with errors","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"^D03905,1,1,0,0,0,0,0,0,1,0,0,0,1,0,0,0,1c�","payloadType":"str","x":180,"y":60,"wires":[["d2a6f2715590216e"]]},{"id":"3f2f05ca372767b6","type":"change","z":"d1395164b4eec73e","name":"set messages ","rules":[{"t":"set","p":"messages","pt":"msg","to":"{\"00\":\"no error\",\"01\":\"fan is locked\",\"02\":\"Over temperature\",\"03\":\"Battery voltage is too high\",\"04\":\"Battery voltage is too low\",\"05\":\"Output short circuited or Over temperature\",\"06\":\"Output voltage is too high\",\"07\":\"Over load time out\"}","tot":"json"},{"t":"set","p":"errors","pt":"msg","to":"[\"line failed\",\"output short circuit\",\"error3\",\"error4\",\"error5\",\"error6\",\"error7\",\"error8\",\"error9\",\"error10\",\"error11\",\"error12\",\"error13\",\"error14\",\"error15\",\"error16\"]","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":600,"y":60,"wires":[["7b4c9e07110bece1"]]},{"id":"7b4c9e07110bece1","type":"split","z":"d1395164b4eec73e","name":"split string of numbers","splt":",","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":800,"y":60,"wires":[["08fdaa49d434e7c8"]]},{"id":"08fdaa49d434e7c8","type":"switch","z":"d1395164b4eec73e","name":"","property":"parts.index","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"num"},{"t":"else"}],"checkall":"true","repair":true,"outputs":2,"x":190,"y":120,"wires":[["e3b8cb78b1a99462","f8867d01ab4e393b"],["abf0013bbbe7f563"]]},{"id":"e3b8cb78b1a99462","type":"change","z":"d1395164b4eec73e","name":"set messages for index 0 & topic","rules":[{"t":"set","p":"payload","pt":"msg","to":"messages[msg.payload]","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"INVERTER_IGRID/Risposta_Inverter/Fault-Warning/Codice Errore Info","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":160,"wires":[["d0c9074f6f0451c5","066b2da6fd46e71f"]]},{"id":"abf0013bbbe7f563","type":"change","z":"d1395164b4eec73e","name":"set index","rules":[{"t":"set","p":"index","pt":"msg","to":"parts.index","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":160,"y":240,"wires":[["5c00f9c480e8e29a"]]},{"id":"f8867d01ab4e393b","type":"change","z":"d1395164b4eec73e","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"INVERTER_IGRID/Risposta_Inverter/Fault-Warning/Codice Errore","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":120,"wires":[["454ac41267df26f1","066b2da6fd46e71f"]]},{"id":"d0c9074f6f0451c5","type":"debug","z":"d1395164b4eec73e","name":"debug 2566","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":715,"y":160,"wires":[],"l":false},{"id":"066b2da6fd46e71f","type":"mqtt out","z":"d1395164b4eec73e","name":"","topic":"","qos":"","retain":"","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"e8ba3ef5.22f4a8","x":1010,"y":160,"wires":[]},{"id":"5c00f9c480e8e29a","type":"switch","z":"d1395164b4eec73e","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"else"}],"checkall":"true","repair":true,"outputs":2,"x":290,"y":240,"wires":[["d41cacb641ab56e5"],["6a4ff04b64d2ee6d"]]},{"id":"454ac41267df26f1","type":"debug","z":"d1395164b4eec73e","name":"debug 2565","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":715,"y":120,"wires":[],"l":false},{"id":"86f56ed6c5026cef","type":"change","z":"d1395164b4eec73e","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"INVERTER_IGRID/Risposta_Inverter/Fault-Warning/Codice Errore Info","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":880,"y":280,"wires":[["97711b68ad9449c4","066b2da6fd46e71f"]]},{"id":"d41cacb641ab56e5","type":"change","z":"d1395164b4eec73e","name":"set error","rules":[{"t":"set","p":"payload","pt":"msg","to":"errors[msg.index]","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":420,"y":240,"wires":[["d3e8d094ec8732eb"]]},{"id":"6a4ff04b64d2ee6d","type":"change","z":"d1395164b4eec73e","name":"set no error","rules":[{"t":"set","p":"payload","pt":"msg","to":"no errors","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":280,"wires":[["692aaf96f2f4bd4f"]]},{"id":"692aaf96f2f4bd4f","type":"trigger","z":"d1395164b4eec73e","name":"errors or no errors","op1":"","op2":"","op1type":"nul","op2type":"payl","duration":"250","extend":true,"overrideDelay":false,"units":"ms","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":690,"y":280,"wires":[["86f56ed6c5026cef"]]},{"id":"97711b68ad9449c4","type":"debug","z":"d1395164b4eec73e","name":"debug 6","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1015,"y":280,"wires":[],"l":false},{"id":"d3e8d094ec8732eb","type":"join","z":"d1395164b4eec73e","name":"","mode":"auto","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":"false","timeout":"","count":"","reduceRight":false,"x":550,"y":240,"wires":[["692aaf96f2f4bd4f"]]},{"id":"e8ba3ef5.22f4a8","type":"mqtt-broker","name":"testb","broker":"192.168.1.25","port":"1883","clientid":"","autoConnect":true,"usetls":false,"compatmode":false,"protocolVersion":"5","keepalive":"60","cleansession":true,"autoUnsubscribe":true,"birthTopic":"","birthQos":"0","birthRetain":"false","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"userProps":"","sessionExpiry":""}]
Maybe watching the essentials videos will give you more insight into what each node type can do.