Recently, we ran into a weird permission problem on OneDrive / Sharepoint with a user account we've set up with an email address that was used more than 2 years ago.
2 years ago, we deleted an Office 365 account of a former employee. Due to a similar name, the new employee took over that email address, and while at first, everything seemed to work fine, we ran into a problem with sharing files via OneDrive.
Accessing the shared files from a Teams chat resulted in a Sharepoint permission problem. The new employee couldn't access any files shared with him. We tested it multiple times, and it never worked. We waited for several weeks and tried it again, but we ran into the same issues repeatedly.
Luckily Microsoft support could help within minutes - which, to be honest, I did not expect.
Apparently, Sharepoint caches user information like crazy. When you delete a user in Office 365, some data is left over on Sharepoint. Due to both user accounts sharing the same email address, Sharepoint messed things up.
The fix is simple: Delete the leftover user information on Sharepoint to let it initialize things properly for the new employee account. How to do that? That's a bit of a tricky part.
In your browser, open your OneDrive Business account and append to this url
The URL then should look like this
On this web page, you'll see a list of all user accounts known in Sharepoint. Find the account that causes the trouble - in our case, the account of the old employee - and delete the account from the website collection. Once the old employee account information was deleted from Sharepoint, sharing files with the new employee account worked fine.