I just tested this endpoint locally and it works fine for me.
A 504 error usually means that the proxy server was unable to receive a timely response from the upstream server it needed to access. There is no standard solution for this, I would suggest retrying the request after waiting for a while. Sometimes, a 504 error is temporary and can be resolved by resubmitting the request.
If the above suggestions do not work, please open a support ticket with the Microsoft support team to get help from the API owner.
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.