You can create an array of payloads and topics and then they will be sent as two seperate mssages to the same output
[[{"payload":1,"topic":"aaa/bbb"},
{"payload":2,"topic":"fff/ggg"}]]
[{"id":"f70ec784.46d18","type":"inject","z":"190c8195.72b3be","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"somegggggggggg/topic/blahblahblah","payload":"","payloadType":"date","x":480,"y":740,"wires":[["39ccfe1.914be82"]]},{"id":"39ccfe1.914be82","type":"function","z":"190c8195.72b3be","name":"","func":"var topic = msg.topic;\nvar payload = msg.payload;\nvar product = \"gggg\";\nvar description=\"fffff\";\nvar price = 123;\nvar thumbnail = \"mmmm\";\nvar id = 123;\nvar msgid = {payload: id, topic:\"anothe/topc\"};\n\nfirst = {payload: description + \"\\r\\n\" + \"Preço : R$ \" + price + \"\\r\\n\",\ntopic: \"esp32/product_return/\"+topic.substr(19)};\nmsg =[[first, msgid]]\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":690,"y":740,"wires":[["6182f651.7b026","7f92c9b6.d14948"]]},{"id":"6182f651.7b026","type":"mqtt out","z":"190c8195.72b3be","name":"","topic":"","qos":"","retain":"","broker":"d675b749.04b9c8","x":840,"y":840,"wires":[]},{"id":"7f92c9b6.d14948","type":"debug","z":"190c8195.72b3be","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":900,"y":740,"wires":[]},{"id":"d675b749.04b9c8","type":"mqtt-broker","name":"Localhost","broker":"localhost","port":"1883","clientid":"","usetls":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]