I'm having a problem loading SharePoint documents for records in my model driven app.

Everything was working perfectly. I rechecked the SharePoint Integration configuration, the permissions, they are all set up correctly.
I can stil upload doucments and save them in SharePoint. When i debug in browser i see the below message when the subgrid is trying to fetch the documents.

{"error":{"code":"0x80040216","message":"An unexpected error occurred.","@Microsoft.PowerApps.CDS.ErrorDetails.ApiExceptionSourceKey":"Plugin/Microsoft.Crm.ObjectModel.SharePointDocumentService","@Microsoft.PowerApps.CDS.ErrorDetails.ApiStepKey":"-cd86--a07b-","@Microsoft.PowerApps.CDS.ErrorDetails.ApiDepthKey":"1","@Microsoft.PowerApps.CDS.ErrorDetails.ApiActivityIdKey":"--4ee3-90ca-","@Microsoft.PowerApps.CDS.ErrorDetails.ApiPluginSolutionNameKey":"System","@Microsoft.PowerApps.CDS.ErrorDetails.ApiStepSolutionNameKey":"System","@Microsoft.PowerApps.CDS.ErrorDetails.ApiExceptionCategory":"ClientError","@Microsoft.PowerApps.CDS.ErrorDetails.ApiExceptionMessageName":"UnExpected","@Microsoft.PowerApps.CDS.ErrorDetails.ApiExceptionHttpStatusCode":"400","@Microsoft.PowerApps.CDS.HelpLink":"http://go.microsoft.com/fwlink/?LinkID=398563&error=Microsoft.Crm.CrmException%3a80040216&client=platform","@Microsoft.PowerApps.CDS.InnerError.Message":"An unexpected error occurred."}}
Any help is much appreciated. I already wasted lots of time trying to understand what happened.