Flashing official stock ROM delete DRM keys if you keep the bootloader locked. If bootloader is unlocked, you’ll lose Sony’s proprietary algorithms (low-light camera noise reduction, X-Reality). You can restore some functions via DRM fix patches (requires root).
Ensure the phone has at least 50% battery to prevent shutdown during the process. Enable USB Debugging: Settings > About Phone Build Number 7 times, then enable "USB Debugging" in Developer Options 3. Downloading the Stock ROM