Hi there
Please try this
Isolate your backup: The next time you erase the phone, set it up as a "New iPhone" instead of restoring from an iCloud or iTunes backup. Use it for 3–4 days. If the issue stops, a glitch in your previous backup files was causing the problem.
Turn off "Rest Finger to Open": Go to Settings > Accessibility > Home Button and toggle off Rest Finger to Open. This forces the phone to require a distinct physical press to unlock, which resets the software scan cycle.
Perform a Force Restart: When the issue starts happening, don't erase the phone. Instead, do a force restart to clear the system cache: Press and quickly release Volume Up, press and quickly release Volume Down, then press and hold the Side (Power) button until the Apple logo appears.
Check for iOS Updates: Go to Settings > General > Software Update to check if there is an update available