Thank you for reaching Microsoft Q&A!
Based on the information you provided, it might be issue with the API permissions, kindly check the API permissions in App registrations and see if have added the Application permissions as per the below document which has explained how to call API which is similar to your issue.
Reference: Service-to-service authentication for automation APIs in Business Central
Service-to-service authentication for Automation APIs
Hope this helps. Do let us know if you any further queries by responding in the comments section. Thanks,
Akhilesh.
------------ If this answers your query, do click Accept Answer
and Yes
for was this answer helpful. And, if you have any further query do let us know.