Error when importing photos from iCloud to Photos on macOS: "The operation couldn't be completed. (PHAssetExportRequestErrorDomain error 2.)"
Diagnosis

By trying to import small groups of photos and videos, I found out that there is one video in the middle of my shared album that doesn't display a proper preview, and it can't be imported to my library. Probably this video is corrupted somehow in iCloud. All other photos and videos can be imported properly. 

Work around

Importing all photos and videos before this corrupted video works, and importing all photos and videos after this corrupted video works as well.