@nisiyama
I have been cleaning up things and now have a flow that will return 12 or 17 elements from an array with a fixed set of data as input (below). I eliminated as much as I could from the flow to keep things manageable, and the flow runs in it's own tab.
I have also taken a screen shot showing my screen. The first debug message comes after a 'Restart Flows', the second message immediately after, it remains at 17 elements after that.
Please let me know if you need anything else.
[{"id":"39b20d7.7470672","type":"tab","label":"Batch Node Test","disabled":false,"info":""},{"id":"f24cf3bb.225c18","type":"batch","z":"39b20d7.7470672","name":"Batch 6 periods","mode":"count","count":"6","overlap":"5","interval":10,"allowEmptySequence":false,"topics":[],"x":180,"y":140,"wires":[["c66cf133.eee248"]]},{"id":"c66cf133.eee248","type":"join","z":"39b20d7.7470672","name":"","mode":"auto","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":330,"y":140,"wires":[["389d8b77.ae9cf4"]]},{"id":"7631bb2e.b9001c","type":"function","z":"39b20d7.7470672","name":"Troublesome array","func":"msg.payload = [{\"value_exc_vat\":5,\"value_inc_vat\":5.25,\"valid_from\":1588541400000,\"valid_to\":1588543200000},{\"value_exc_vat\":5.88,\"value_inc_vat\":6.174,\"valid_from\":1588539600000,\"valid_to\":1588541400000},{\"value_exc_vat\":5.88,\"value_inc_vat\":6.174,\"valid_from\":1588537800000,\"valid_to\":1588539600000},{\"value_exc_vat\":7.46,\"value_inc_vat\":7.833,\"valid_from\":1588536000000,\"valid_to\":1588537800000},{\"value_exc_vat\":6.8,\"value_inc_vat\":7.14,\"valid_from\":1588534200000,\"valid_to\":1588536000000},{\"value_exc_vat\":7.14,\"value_inc_vat\":7.497,\"valid_from\":1588532400000,\"valid_to\":1588534200000},{\"value_exc_vat\":7.64,\"value_inc_vat\":8.022,\"valid_from\":1588530600000,\"valid_to\":1588532400000},{\"value_exc_vat\":8.06,\"value_inc_vat\":8.463,\"valid_from\":1588528800000,\"valid_to\":1588530600000},{\"value_exc_vat\":20.4,\"value_inc_vat\":21.42,\"valid_from\":1588527000000,\"valid_to\":1588528800000},{\"value_exc_vat\":20.4,\"value_inc_vat\":21.42,\"valid_from\":1588525200000,\"valid_to\":1588527000000},{\"value_exc_vat\":20.4,\"value_inc_vat\":21.42,\"valid_from\":1588523400000,\"valid_to\":1588525200000},{\"value_exc_vat\":19.24,\"value_inc_vat\":20.202,\"valid_from\":1588521600000,\"valid_to\":1588523400000},{\"value_exc_vat\":19.31,\"value_inc_vat\":20.2755,\"valid_from\":1588519800000,\"valid_to\":1588521600000},{\"value_exc_vat\":17.88,\"value_inc_vat\":18.774,\"valid_from\":1588518000000,\"valid_to\":1588519800000},{\"value_exc_vat\":5.54,\"value_inc_vat\":5.817,\"valid_from\":1588516200000,\"valid_to\":1588518000000},{\"value_exc_vat\":5.21,\"value_inc_vat\":5.4705,\"valid_from\":1588514400000,\"valid_to\":1588516200000},{\"value_exc_vat\":5.04,\"value_inc_vat\":5.292,\"valid_from\":1588512600000,\"valid_to\":1588514400000}];\nreturn msg;","outputs":1,"noerr":0,"x":330,"y":100,"wires":[["21a98821.b254d8"]]},{"id":"118eccdd.e0f5b3","type":"inject","z":"39b20d7.7470672","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":140,"y":100,"wires":[["7631bb2e.b9001c"]]},{"id":"21a98821.b254d8","type":"split","z":"39b20d7.7470672","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":490,"y":100,"wires":[["f24cf3bb.225c18"]]},{"id":"6c201645.253fc","type":"join","z":"39b20d7.7470672","name":"Create Array","mode":"custom","build":"array","property":"test","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"2","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":330,"y":180,"wires":[["d88af334.d083e"]]},{"id":"d88af334.d083e","type":"debug","z":"39b20d7.7470672","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":490,"y":180,"wires":[]},{"id":"389d8b77.ae9cf4","type":"change","z":"39b20d7.7470672","name":"Transform","rules":[{"t":"set","p":"test.start","pt":"msg","to":"payload[5].valid_from","tot":"msg"},{"t":"set","p":"test.time_end","pt":"msg","to":"payload[0].valid_to","tot":"msg"},{"t":"set","p":"test.value","pt":"msg","to":"payload[0].valid_to","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":140,"wires":[["6c201645.253fc"]]},{"id":"c605b2b4.73fa4","type":"comment","z":"39b20d7.7470672","name":"Batch Node Test","info":"","x":140,"y":54,"wires":[]}]