Wasn't sure if I should have posted my reply in the Comment or Answer sections, so I decided to do both :
I got the same problem and it's annoying. The window wouldn't go away on its own.
After having searched Microsoft website for help, I read someone in the Microsoft community (in another thread) suggesting holding Windows and R keys and then typing - %localappdata%\Microsoft\OneDrive\OneDrive.exe /reset
The process should take 1-2 minutes. Then you can click on the window, it should be able to close.
It's not a permanent fix, but it does help get rid of the annoying "window".
Then, you'll have to repeat it again because the window is going to re-appear after midnight (or, when the next day begins).
In my case, deleting the OneDrive and reinstalling didn't work, because my laptop works in S mode, which means it can only download apps from the official Microsoft Store, that "conveniently" does not have OneDrive available anymore. The file is now available only from the external source, which my computer cannot download from!! If Microsoft team reads my answer, maybe they could help and put the program back in the Microsoft Store, that would save a lot of users a headache, like in my case.