Originally Posted by Gastozz
Did you encrypt your device? Otherwise, format all, especially the data, except the SDCard.
Then delete the Android and LOST.DIR folders on the sdcard by navigating through the TWRP file manager. Restart.
Perform the process again by installing TRIM + TWRP 3.1.0. Restart in System> Recovery.
If you have encrypted, I think you will have to install the stock ROM with the indicated pit and do the process again.
Back Up First.