Same exact thing happened to me after updating to Sonoma.
I had to actually find a way around this -- "The file "Application.musicdb" cannot be read. An unknown error occurred (-54)."
Before it would even read my Apple Music library.
Long story short, I just created a new one and replaced the old one, and it worked apparently.
The only thing now is when I right click and choose "add to playlist" it only lists 8 playlists, and I have at like 50 playlists.
And the 8 playlists it lists are totally random.
I've been using Apple like 25 years, and never dealt with a single bug until the M2 chip.
I like how my laptop no longer overheats, or makes weird fan noises, but just about everything else went downhill.
It took them almost a year to finally address and fix this major bug that wouldn't recognize files that were put into a new folder.
Now the GUI makes weird glitches when moving files.
The latest update also messed with my Bean writing app.
It's like they make us buy a new laptop every 5 years because of planned obsolescence. And then they replace it with something even worse.
Itunes was so much better than what we have now for example.
I can't use that old photoshop Cs6 that I loved and spent years learning.
It's like that old phrase if it aint broke don't fix it, but in reverse.
I hate it when they force us to use new apps or technology just to get more money out of us, but replacing it with something even worse is like pouring salt in the wound.