Seen this some times before, and the way I fixed it, was by turning off the federation and re-established it again...
On your ADFS server (not proxy) do following:
Connect-MsolService
Update-MsolFederatedDomain
Convert-MsolDomainToStandard -domainname mydomain.com -passwordfile pass.txt -skipuserconversion $true
This will break federation to Office 365. No mailboxes, settings, etc will be lost! But users can't login until its turned on...
Convert-MsolDomainToFederated
This command will re-establish federation to Office 365
Update-MsolFederatedDomain
Restart proxy server, run the ADFS wizard to ensure the proxy could communicate to the primary ADFS server, and wait two minute.