You could alternatively use Object.assign
...
msg.payload ='payload';
msg.topic = 'topic'
msg1 = Object.assign({}, msg);
msg2 = msg;
msg2.payload ='payload2';
msg2.topic = 'topic2';
//
return [msg1, msg2];
[{"id":"f8bb35e4.ae0038","type":"inject","z":"c9c4eeb8.bad8e","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":2280,"wires":[["82cdef83.e8b54"]]},{"id":"ad5eb769.75d0a8","type":"debug","z":"c9c4eeb8.bad8e","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":570,"y":2250,"wires":[]},{"id":"82cdef83.e8b54","type":"function","z":"c9c4eeb8.bad8e","name":"","func":"msg.payload ='payload';\nmsg.topic = 'topic'\n\nmsg1 = Object.assign({}, msg);\n\nmsg2 = msg;\n\nmsg2.payload ='payload2';\nmsg2.topic = 'topic2';\n//\nreturn [msg1, msg2];","outputs":2,"noerr":0,"initialize":"","finalize":"","x":370,"y":2280,"wires":[["ad5eb769.75d0a8"],["2a82a40a.f9536c"]]},{"id":"2a82a40a.f9536c","type":"debug","z":"c9c4eeb8.bad8e","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":574.765625,"y":2315,"wires":[]}]