How to get image/video from PHPicker correctly?

Few days ago, we update our image picker to PHPicker for iOS 14 users. But now there are some users complained that they can't choose meida now. Then we tested on several models of iPhone, finally we found this bug on a iPhone 6s. It says: [ERROR] Could not create a bookmark: NSError: Cocoa 257 "couldn't be opened because you don't have permission to view it".
I've noticed some similar situation in the forum, but none of them fix my situation. Here is my code, how can I fix it? Thanks

Code Block swift
func picker(_ picker: PHPickerViewController, didFinishPicking results: [PHPickerResult]) {
    if results.isEmpty {
      picker.dismiss(animated: true, completion: nil)
      return
    }
    if options.mediaType == .image {
      handlePickedImages(providers: results.map(\.itemProvider))
    } else {
      results.first.map(\.itemProvider).on {
        handlePickedVideo(provider: $0)
      }
    }
  }
func handlePickedImages(providers: [NSItemProvider]) {
    var images: [UIImage?] = Array(repeating: nil, count: providers.count)
    for (index, provider) in providers.enumerated() {
      provider.loadObject(ofClass: UIImage.self) { [weak self] (image, error) in
        ......
      }
    }
}
func handlePickedVideo(provider: NSItemProvider) {
    provider.loadFileRepresentation(forTypeIdentifier: provider.registeredTypeIdentifiers.first ?? "") { [weak self] (url, error) in
......
}
}


On my phone, only choose video will trigger this bug, but we have users says they can't choose photos too.

It's likely that some selected assets need to be downloaded from the iCloud Photos Library. Please check if you have a stable internet connection. You can also show an indeterminate progress indicator while downloading assets, and report possible network errors to users.
How to get image/video from PHPicker correctly?
 
 
Q