I've been trying to find something on this problem for a few months, but I keep getting the "use music to find duplicate tracks" response.
The songs that are duplicated are purchased music. Doesn't matter if it's from the iTunes Store, BandCamp, Amazon, etc., the songs are imported, uploaded to my iCloud Library, and then on my mac I have two (for some tracks three) versions of the song. One that's in iCloud and one that's not in iCloud.
This isn't just "duplicate songs" in my library. Songs and playlists are duplicating only on my mac. iOS looks normal. When I first notice it months prior, there was the playlist in full and the duplicate list was empty, but had cover art and description. This goes for all playlists. Ones I made myself, Smart Playlists, ones I added from Apple Music, and ones my friends sent me through Apple Music. I would just delete the empty one and it would be all good until I had to quit the app and reopen it. They would be right back.
It wasn't until recently that the duplicated playlists weren't exactly the same. Now half of the songs are in one playlist and the other half are in the other. If I delete one playlist, both of them delete from my computer and Apple Music on why other devices. It seems to only be playlists in which I'm mixing Apple Music songs and purchased music.
This problem is only on my Mac and it's driving me crazy. My Music Library on iOS says I have 10,317 songs. On my mac, it says 16,379. I don't know if the issue is on my end or in the software.