Hi @openclue ,
Please add a Compose under the Execute a SQL query (v2) action and insert the Body to the Compose.
Then you could add an expression to the Apply to each as screenshot below:

The expression in the Apply to each as below:
outputs('Compose')?['ResultSets']?['Table']
The expression in the Compose 3 as below:
outputs('Compose_2')?['tab']
The flow would run successfully as below:

Best regards,
Alice
Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.