I’m seeing this too: the call arbitrarily blows-up when saving larger playlists. There doesn’t seem to be a specific upper limit - sometimes 3,000 tracks will fail, other times 6,000 tracks will work fine. Suspect it depends on server loads (fyi 500 is a gateway error).
It wouldn’t be so bad if you could break the call up and add to a playlist chunk by chunk but the “new” MusicKit call to add to a playlist is completely unusable as it seems to map to the old (comically slow) MPMediaPlaylist.addItem method.
The other interesting thing you will find is that if you read the playlist tracks immediately after creating a new playlist, there aren’t any. They come along a few seconds later. So much for async/await. Worse still, if there’s a failure between when the call apparently “succeeded” and when the tracks subsequently appear, it’s completely silent. You just end up with a playlist with no tracks.
I get the impression that Apple are not eating what they cook when it comes to MusicKit.
And incidentally all of the above issues have been reported by me via Feedback Assistant for months without so much as an acknowledgement.