Here is a work-around. I am not sure how robust it is, particularly if messages arrive faster than the faulty node can process them.
[{"id":"396ed32beb653e14","type":"inject","z":"f14e4f2a567f3bb1","name":"","props":[{"p":"payload"},{"p":"foo","v":"bar","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":120,"y":120,"wires":[["270467aa371fa522","e476f0df3fc96329","191d58b73a7ce26c"]]},{"id":"270467aa371fa522","type":"function","z":"f14e4f2a567f3bb1","name":"Your bad node here","func":"msg = {\"payload\": msg.payload}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":310,"y":140,"wires":[["553d7f893ecab85c"]]},{"id":"e476f0df3fc96329","type":"change","z":"f14e4f2a567f3bb1","name":"msg.topic=foo","rules":[{"t":"set","p":"topic","pt":"msg","to":"foo","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"foo","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":320,"y":100,"wires":[["a8b43f8cabacd091"]]},{"id":"553d7f893ecab85c","type":"change","z":"f14e4f2a567f3bb1","name":"msg.topic=payload","rules":[{"t":"set","p":"topic","pt":"msg","to":"payload","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":530,"y":140,"wires":[["a8b43f8cabacd091"]]},{"id":"a8b43f8cabacd091","type":"join","z":"f14e4f2a567f3bb1","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":710,"y":100,"wires":[["96e4bf652ba97c04"]]},{"id":"96e4bf652ba97c04","type":"debug","z":"f14e4f2a567f3bb1","name":"Output data","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":730,"y":180,"wires":[]},{"id":"191d58b73a7ce26c","type":"debug","z":"f14e4f2a567f3bb1","name":"Input data","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":280,"y":180,"wires":[]}]
Note that it does not reconstruct the message exactly as it was - the input has msg.payload and msg.foo, the output has msg.payload.payload and msg.payload.foo.
You could use another change node to fix this.