[Part 1] Flashing not working - either writing userdata fails or keys don't match + [part 2] encrypting userdata on first startup does not finish

Good advice! I would also reflash Android via EMMA tool. This helped me also once with my Xperia 10+.