This occasionally happens to me when flashing the Z3C and other Sony devices. I can usually get round it by taking the following steps in TWRP:
I hope that helps
- Backup your data partition
- Format - not just wipe - the data partition
- Flash the new ROM - I usually do it by installing from SD card, but `adb sideload` should work too
- Boot the phone and go through the setup wizard app, setting any screen pattern or PIN you had previously.
- Restore the backup of your data partition
Thank you very much ! It was indeed the right procedure !
It saved me a lot of time. Thanks.