This bug has been there for years, probably a decade.
I got similar symptoms as mentioned, I suspected AFS+, but what do I know. It has happened on at least 3 iphones (pros), now when I think about it, I don’t remember any iphone I haven’t have troubles with. Having 5000+ images (non-raw) where 5-10% are corrupt is infuriating, but I just stupidly buy another iphone every year (the most expensive one).
Re-importing images 10-100 times could sometimes extract a few additional images, but the phone just disconnects after a while when running such scripts.