Hi,
When Apple Music was first installed and launched it should have detected any existing iTunes library in the standard location, converted that to a new Apple Music library, complete with references to your local media, and then ignored the old library thereafter. Apple Music for Windows at this stage still seems to lack vital features of iTunes, such as the ability to rip CDs, manage multiple libraries, or allow automation via scripts to manage complex metadata edit. Over the years iTunes/Music has shown an occasional issue during an update when the new library doesn't get rebuilt properly. When this happens the library can appear empty, or with fewer tracks than expected, lost playlists, or content that should be stored locally is treated as being in the cloud. See Empty/corrupt iTunes/Music library after upgrade/crash - Apple Community for more on this. Of note is that if you have a subscription to Apple Music or iTunes Match you may not initially notice any discrepancy, particularly as Apple have deemphasized the distinction between local and cloud items over the years. It is also worth noting that updating the location of the media folder doesn't cause the app to re-catalogue what is in that folder.
Depending on when things went wrong you might want to revert to an older version of your Music database, or revisit the migration from iTunes to Apple Music, possibly fixing the iTunes library first, or look to simply bring the local library back up to date by importing any local media, and then downloading what remains in the cloud.
Assuming the tracks you want to reintegrate into the library are stored locally it should be a case of adding the media folder to library, which Music should merge with the cloud content, retaining date added info, ratings, play counts, playlist membership, etc. Nevertheless I would advise backing up the library database before you start, and test by importing one or two albums first to see what happens. Alternatively you can select batches of cloud content and download by right-clicking, but this will take additional space in the active media folder. See Add and download music from Apple Music - Apple Support. An easy way to streamline this process is to create a smart playlist with the rule Location is Not on this computer limited to say 100 items. You can then use Ctrl+A to select all items in the list, right-click and Download, do something else while the selected items are downloaded and eliminated from the list, then rinse and repeat.
tt2