Same here, using iOS 14.0.1 . I had to use a predicate along with the persistentId of the song and use the function .add() instead of .addItem()
let query = MPMediaQuery.songs()
let pred = MPMediaPropertyPredicate(value: "4810553823034020895" , forProperty: MPMediaItemPropertyPersistentID)
query.addFilterPredicate(pred)
let songs = query.items! as [MPMediaItem]
mediaPlaylist.add(songs, completionHandler: { (error) in
guard error == nil else {
fatalError("An error occurred while adding an items to the playlist: \(error!.localizedDescription)")
}
print("SONGs \(identifier) ADDED")
}
Noticed only downloaded songs could be added to the playlist. Otherwise the function won't add the song to the playlist.
Hope that help somehow.