Been facing this exact problem myself with a new Azure Function for a small project where calling the function API (either via browser or with Postman) would result in "The page cannot be displayed because an internal server error has occurred."
Through some trial and error after reading the the steps you had also ruled out I switched from "Express" mode to "Advanced" mode in Active Directory Authentication. Here I noticed that the Issuer Url was set to something which didn't seem right from previously configuring this type of auth (i think it was https://sts.microsoft.com). What ever web site it was it was not a valid URL and didn't resolve.
As my security is restricted to my specific tenant I set the Issuer Url to https://login.microsoftonline.com/{{tenant_id}}. This fixed the issue as now when I called the API from PostMan I would get the "You do not have permission to view this directory or page." with an invalid token supplied.
Note: I also added a Client Secret just to improve the security, but I am doubtful that influenced the issue as I tried that before changing the Issuer URL.
Let us know if that helps you.