It all started with a factory reset on the stock Samsung ROM (Android 7.0).
After I booted into the factory reset system I couldn't get the phone encryption to work: it failed with the message saying that the data partition is corrupt which effectively factory reset my phone again (forcefully).
- Reflashing the official Samsung ROM didn't help, the phone kept showing me the same message about the corruption of the data partition.
- Reformatting the partition in the TWRP didn't help either.
Any ideas how to fix it? It could also be a hardware failure.
I posted the same question on XDA but unfortunately got no response so far.