Problem
Recently, while setting up SharePoint integration in Power Pages, we faced the issue below.
Solution
Recently, while setting up Document integration in Power Pages for Customer form, we configured all the actions required for the integration. SharePoint integration was already working fine in the Sales app. After verifying the configuration steps, when we tried to look into Power Pages, we got the above error. We tried to open the SharePoint document location to make sure it is associated correctly and that the SharePoint url is targeting the correct location. When we tried to see if there was anybody else faced a similar issue, we found a couple of responses where most of the links pointed out that an error occurs if we are trying to access the SharePoint location without enabling SharePoint integration for the entity, so we reverified it. We tried to test it integration with the Case entity, and it worked fine without any errors.
After troubleshooting for a while, we though of setting a trial and test SharePoint integration there. In the test environment, we configured the same steps, and it worked.
Finally, we thought of opening a support ticket with Microsoft, and after many hits and trials, we got a response from Microsoft that this issue was happening because of the relative URL of the document location of the record. Under relative URL, an Account was used for the document library while it should be an account. Normally, this is not an issue for the Sales app integration as it was working fine, but it seems that the SharePoint integration in Power Page should match the name of the document library exactly.