iOS and iPadOS 17.5.1 Update: Fix for Photo-Undeleting Bug
Today Apple released an update for iOS and iPadOS 17.5.1 to fix a very rare but concerning bug in which previously deleted photos could reappear if the database for your Photos app had corruption. It appears that in rare circumstances, a photo that had been deleted was never fully removed from your device but it was removed from the database. Something in last week's iOS 17.5 update caused some of these photos to resurface, perhaps in an attempt to repair database corruption.
Even if you haven't experienced this bug I recommend installing the update, because it is implied that there may be additional bug fixes.