We recently got this error in our web application while trying to fetch some records from one for CRM On-premise organization.
This error was because we had recently configured IFD for that CRM Server.
We had around 6 organizations in that particular deployment and because of security reasons, we didn’t use the wildcard SSL certificate and had a single certificate with multiple subject alternative names (SAN Certificate), and this organization was not part in it.
Fortunately, it wasn’t the case in our production environment and we had this organization part of the SAN Certificate used for IFD configuration there.
So as a quick and temporary fix, as we just wanted to test a couple of methods, we disabled the Claims Based Authentication / IFD from the deployment manager for that short period.
Hope it helps..