MacBook applications say "no photos" but they are on the iPhone
Turning it off and on again
The first and easiest solution was to restart the iOS device (I found this while trying the second solution). Then both Image Capture and Photos were able to see and download the photos and videos, although Image Capture gave an error 50:
I needed to restart the device to import a few remaining photos. Image Capture is still unable to delete photos from the device after multiple attempts: a gray box says "Deleting..." and it hangs. I am now backing up the data, restoring the firmware, and restoring the data.
Using the cloud
I set up iCloud on the iOS device and on the computer to share photos: Settings > iCloud > Sign in, then when asked for an iCloud passcode I entered the lock screen code (hint from discussions.apple.com, and I also had to enter the login password of the computer.
The media did not sync immediately, so I went into the iOS Photos application and realized it had hung, so I restarted the device and then Image Capture started working again. Nevertheless, iCloud photos did not sync the photos from the device.
Other alternatives are the Dropbox and Google Drive apps on iOS. Because I got the photos from the first solution above, I did not try these.
Update (September 2020): After one year of syncing photos with Image Capture and deleting them manually, I have toggled the delete behavior back to normal with some unknown reason. Now when I sync photos, they are deleted from the device. It may be due to the same problem, which caused the behavior again and toggled the problem back to normal. What I did this time was to unplug the cable during transfer of videos, then no photo would transfer and I was unable to delete photos on the device and a new photo would have the button "All photos" greyed out (even though I still had those videos), I restarted the device and now it is working again.