Hi there,
I would require more information about the error, like a screenshot or something to help you. Quick question — do you have a premium license? For your flow, I think this action requires a premium license.
AI Foundry actions are part of AI Builder, and those are considered premium features in Power Automate.