I'm not entirely clear if the whole library is stored in One Drive, or just the media.
Reinstalling iTunes does not fix a damaged library.
Options are to restore a pre-upgrade copy of the library, either the backup made by iTunes in the Previous iTunes Libraries folder, one made using third party software (does One Drive capture multiple versions of files like DropBox?) or by rescanning the media folder with File > Add Folder to Library. The last method should import all of the media, but some may not be categorized correctly and you lose ratings, play counts, playlists, date added and other details.
iTunes expects every file added to the library to stay in place. There are ways to move the data around from one location to another, but it has to be done in a way that iTunes is either in control of, or can easily adjust to. Details in Make a split library portable.
Almost every activity in iTunes causes the database to be rewritten. The steps are that iTunes writes out a new temporary copy of the file, deletes the original, then renames the temporary copy to replace the original file. Any process that attaches to the file system to watch for activity has the potential to disrupt this process. That includes both anti-virus software and live backup or cloud sharing tools, and it occasionally happens with iTunes itself when it updates the internal structure of the database, making an archive copy of the current library file in the Previous iTunes Libraries folder before it does so.
As given in both my user tip and the document If you don't see your entire library after you update iTunes on your Mac or PC - Apple Support the recovery steps are to rename or delete the existing active database file, copy in the archived version, and rename it so that it becomes the active file.
tt2