While function Test-DeviceIntuneConnectivity checks if there is a configured proxy and calls Invoke-WebRequest accordingly, the required previous functions Get-M365CommonEndpointList and Get-IntuneEndpointList call invoke-restmethod without using the proxy. So both functions fail.