Could you clarify what the tag1 variable represents? It seems the issue might be in your Lua script’s syntax. Lua uses double square brackets ["key"] instead of curly quotes “key”, so, instead of data[“Temp”], try using data["Temp"] and, in sum’s returning script, { "sum": %=sum% }.
Additionally, is the Modbus data being received on your MQTT client in other JSON or custom formats?