I just made multiple calls to the API locally and it worked fine for me, so it doesn't look like a known issue. This should be related to your environment, calling the API in your context throws the above error.
I suggest you open a support ticket to report the issue to the Microsoft support team, and the support team can help you pull the background log to find out the cause of the issue.
Hope this helps.
If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.