I've been experiencing the same sort of issue since 22 April, in 3 separate applications, and have yet to find a resolution. Support ticket has been open with Microsoft for a week now with no progress. My errors are:
SharePointPnP.IdentityModel.Extensions.S2S.Protocols.OAuth2.OAuth2S2SClient.Issue(String securityTokenServiceUrl, OAuth2AccessTokenRequest oauth2Request)
The remote server returned an error: (401) Unauthorized. at System.Net.HttpWebRequest.GetResponse() at SharePointPnP.IdentityModel.Extensions.S2S.Protocols.OAuth2.OAuth2WebRequest.GetResponse() at SharePointPnP.IdentityModel.Extensions.S2S.Protocols.OAuth2.OAuth2S2SClient.Issue(String securityTokenServiceUrl, OAuth2AccessTokenRequest oauth2Request)