Hi @Sajed Almorsy
This is not related to the upcoming deprecation of the AAD Graph API, because you are using the MS Graph endpoint instead of the AAD Graph endpoint. The 500 error is an internal server error that can happen for a variety of reasons and we cannot reproduce it locally.
I recommend you to open a support ticket with the Graph support team to confirm the problem, you can raise a support ticket from:
http://aad.portal.azure.com or https://admin.microsoft.com/#/support/requests.
Hope this helps.
If the answer is helpful, please click Accept Answer and kindly upvote. If you have any further questions about this answer, please click Comment.