Thanks for the clarification!
It sounds like you're adding the songs from your flash drive to your Apple Music Library, but you're not copying the songs from the drive to the Mac's drive. As a result, when the drive is removed, the songs can no longer be found.
This was also the expected functionality in older versions of iTunes.
The reason it functions this way, is that some users may want to add this music without copying the files to their Mac, so music can be stored on a large external drive, they intend to keep attached, without taking up space on the Mac or Windows computer.
In your case, if you want to keep the songs on your Mac so they play when the drive is not attached, start by making sure that the songs you add, are also copied over.
Using the Automatically Add to iTunes option is one solution.
You can also customize iTunes settings, so songs you add are copied to your computer's hard drive.
- Open the Music app
- From the menu bar, choose Music > Preferences
- Click Files
- Check the "Copy files to Music Media folder when adding to library"
Additional information is available here: Change Files preferences in Music on Mac
We hope this helps!