Let's assume you have a REST custom connector where you have PATCH operation. When that is called from a button, it is returning 202OK (also tested with 204) and error 'The data returned in the response is invalid' is showed in PowerApps.
Exactly the same service from the connector works in Flow. It seems that PowerApps care about the response and do not like 202/204 status coded for PATCH/PUT operations.
Can you please fix it, it is annoying.
I suspect the issue here should be caused by PowerApps can't handle the JSON data.
By the way, could you please take a look to see if the 202 and 204 response has been defined under the Response part when creating the Custom Connector in PowerApps?
If the corresponding response has been defined, then it should be available for PowerApps to handle the response.
For the current situation, please consider take use of Send Response to PowerApps with Microsoft Flow as a workaround.
we have webAPI with openAPI sitting in the backend, in there teh swagger will read annotations on the controller combined with the function. Connector will read this information when you will create it from OpenAPI file or OpenAPI Url. OpenAPI is generated by Swagger/Swaschbuckle.