There will be no 100% fault proof handling to this issue, the only issue is to retry the connection again when it happens. Like what you said in between of IS to Dynamics CRM to obtain the token, you’ve proxy server that mediate all the traffic out. There is still chance anything in between that caused the issue.
Unless you can further check on the proxy server log to see if there is any issue during that time, it would be rather difficult to pinpoint where the root cause is. Another thing that you can probably try out is to only see if without going through proxy but a direct connection to Azure, do you still see such exception happening over the time? If no, at least you can narrow down where the issue is.