Hello Eldi,
Thanks for your question.
I will recommend the following troubleshooting steps:
Check the request body for details of properties. Also confirm you're using the correct principal ID
For adding a password to a service principal, you should be using the Microsoft Graph API. It should have the general format:
POST https://graph.microsoft.com/v1.0/servicePrincipals/{id}/addPassword
See:
https://learn.microsoft.com/en-us/graph/api/serviceprincipal-get?view=graph-rest-1.0&tabs=http
You can also check that the logic app has the sufficient permissions assigned.
Do remember to 'Accept Answer' and 'Upvote' if the above information was useful
Regards,
Abiola