Hi @HFG ,
Do you add a Condition action after the "Respond to PowerApps" action in your flow?
Based on the flow's configuration that you provided, I think there is something wrong with it. If you want to pass data from a flow back to an app using the "Respond to PowerApps" action, you should define the "Respond to PowerApps" action as last action in your app.
Please consider remove the actions (condition action) under the "Respond to PowerApps" action within your flow, then re-save your flow, try the formula again, check if the issue is solved.
In addition, please make sure the ReturnCode dynamic content from the "Execute SQL procedure (V2)" action is also a Number value. You could also consider use int() function to convert the ReturnCode dynamic content value into a number value as below:
set the value box for the number output to following formula:
int(body('Execute_stored_procedure_(V2)')?['returncode'])
Please take a try with above solution, check if the issue is solved.
Best regards,