you have described my power automate flow, but these are the limits of this approach.
I cannot find any documentation about this javascript/typescript method "window.PowerApps.invokeMethod"
In Canvas App you can run a power automate flow with "Run" command.
In a Model driven App command button doens't support the Run command, so you cannot run a power automate workflow with PowerFx "Run" command and I cannot use PowerFx instructions in a PCF control because I must use javascript/typescript like language.
So in a Model Driven App the only solution remains:
1) create an instant cloud flow to get token that have like first component "When HTTP request is received" and like last component an HTTP response with token returned
2) call this flow from PCF control by javascript/typescript
3) use the token for future calls
The limit of this approach is that is not portable between different environments, because the HTTP post url generated from "When HTTP request is received" changes according environment and there is no way to give it by dataverse or other api calls, unless you don't save this url in an environment variable that will change according environment.
I am looking for a portable way to make api call without use an environment variable to save url to get the token.