Microsoft’s explanation about how to use OneDrive with an external drive while using the Apple mandated fileproviderd extension and the ~/Library/CloudStorage location is within this article:
https://techcommunity.microsoft.com/t5/microsoft-onedrive-blog/inside-the-new-files-on-demand-experience-on-macos/ba-p/3058922
The issue has come up in various Dropbox Community posts without resolution eg here and here.