The iOS 15 software update has been found to reduce, and in some cases completely remove unwanted iPhone lens flare artifacts in photographs taken with Apple's stock Camera app.
iOS 15 Camera automatically removes unwanted lens flare in your iPhone photos