[General Questions and Answers] Auggystyle:
So, I've been banging my head off the wall the last few days trying to root my phone. I keep running into grave issues, and have finally pinned down the cause, although I am unable to understand why.

My boot loader is unlocked, and I am currently running a flashed stock ROM, version 39.2.A.0.417, which was installed using Xperifirm and Flashtool. I was running a custom ROM, 7.1.1 from user Adrian prior to this, but went back to the stock ROM due to the instability of the custom ROM. Here is a log of what the install looks like.

27/059/2017 22:59:41 - INFO - <- This level is successfully initialized

27/059/2017 22:59:41 - INFO - Flashtool Version 0.9.23.2 built on 19-01-2017 21:50:00

27/059/2017 22:59:41 - INFO - Executing search strategies to find proxy selector

27/059/2017 22:59:41 - INFO - No proxy found for IE. Trying next one

27/059/2017 22:59:41 - INFO - Strategy firefox failed trying next one : No Firefox installation found

27/059/2017 22:59:41 - INFO - No proxy found for java. Trying next one

27/059/2017 22:59:41 - INFO - Syncing devices from github

27/059/2017 22:59:42 - INFO - Opening devices repository.

27/059/2017 22:59:42 - INFO - Scanning devices folder for changes.

27/059/2017 22:59:45 - INFO - Pulling changes from github.

27/059/2017 22:59:45 - INFO - Quietly closing devices repository.

27/059/2017 22:59:45 - INFO - Devices sync finished.

27/059/2017 22:59:45 - INFO - Loading devices database

27/059/2017 22:59:45 - INFO - Loaded 94 devices

27/059/2017 22:59:45 - INFO - Starting phone detection

27/059/2017 22:59:50 - INFO - Device disconnected

27/000/2017 23:00:12 - INFO - Selected Bundle for Sony Xperia X Performance(F8131). FW release : 39.2.A.0.417. Customization : Usa

27/000/2017 23:00:12 - INFO - Preparing files for flashing

27/000/2017 23:00:34 - INFO - Please connect your device into flashmode.

27/001/2017 23:01:13 - INFO - Device connected in flash mode

27/001/2017 23:01:13 - INFO - Opening device for R/W

27/001/2017 23:01:14 - INFO - Reading device information

27/001/2017 23:01:14 - INFO - Phone ready for flashmode operations.

27/001/2017 23:01:14 - INFO - Opening TA partition 2

27/001/2017 23:01:14 - INFO - Current device : F8131 - CB512A3LQT - 1302-4823_R3C - 1303-0851_39.2.A.0.417 - GENERIC_39.2.A.0.417

27/001/2017 23:01:14 - INFO - Closing TA partition

27/001/2017 23:01:14 - INFO - Start Flashing

27/001/2017 23:01:14 - INFO - No loader in the bundle. Searching for one

27/001/2017 23:01:14 - INFO - No matching loader found

27/001/2017 23:01:14 - WARN - No loader found or set manually. Skipping loader

27/001/2017 23:01:14 - INFO - Loader : S1_Root_de8d - Version : 1299-4832_S1_Boot_MSM8996_LA2.0_N_110 / Boot version : 1299-4832_S1_Boot_MSM8996_LA2.0_N_110 / Bootloader status : ROOTED

27/001/2017 23:01:14 - INFO - Max packet size set to 4M

27/001/2017 23:01:14 - INFO - USB buffer size set to 512K

27/001/2017 23:01:15 - INFO - Parsing boot delivery

27/001/2017 23:01:15 - INFO - Found a template session. Using it : C:\Users\auggy\.flashTool\firmwares\prepared\39.fsc

27/001/2017 23:01:15 - INFO - Set loader configuration : [00 01 00 00 00 0C]

27/001/2017 23:01:15 - INFO - Opening TA partition 2

27/001/2017 23:01:15 - INFO - Writing TA unit 00002774. Value : 01

27/001/2017 23:01:15 - INFO - Closing TA partition

27/001/2017 23:01:16 - INFO - Processing partition.sin

27/001/2017 23:01:16 - INFO - Checking header

27/001/2017 23:01:16 - INFO - Flashing data

27/001/2017 23:01:16 - INFO - Opening TA partition 2

27/001/2017 23:01:16 - INFO - Processing cmnlib_S1_Boot_MSM8996_LA2_0_N_110_AID_4_PLATFORM-TONE-COM-LIVE-HWID009470E1-SWID0C-APPID01-OEM1-AID4-DEBUG00_S1-BOOT-LIVE-DE8D-0004-MMC.sin

27/001/2017 23:01:16 - INFO - Checking header

27/001/2017 23:01:16 - INFO - Flashing data

27/001/2017 23:01:17 - INFO - Processing devcfg_S1_Boot_MSM8996_LA2_0_N_110_AID_4_PLATFORM-TONE-COM-LIVE-HWID009470E1-SWID05-OEM1-AID4-DEBUG00_S1-BOOT-LIVE-DE8D-0004-MMC.sin

27/001/2017 23:01:17 - INFO - Checking header

27/001/2017 23:01:17 - INFO - Flashing data

27/001/2017 23:01:17 - INFO - Processing emmc_appsboot_S1_Boot_MSM8996_LA2_0_N_110_AID_4_PLATFORM-TONE-COM-LIVE-HWID009470E1-SWID09-OEM1-AID4-DEBUG00_S1-BOOT-LIVE-DE8D-0004-MMC.sin

27/001/2017 23:01:17 - INFO - Checking header

27/001/2017 23:01:17 - INFO - Flashing data

27/001/2017 23:01:17 - INFO - Processing hyp_S1_Boot_MSM8996_LA2_0_N_110_AID_4_PLATFORM-TONE-COM-LIVE-HWID009470E1-SWID15-OEM1-AID4-DEBUG00_S1-BOOT-LIVE-DE8D-0004-MMC.sin

27/001/2017 23:01:17 - INFO - Checking header

27/001/2017 23:01:17 - INFO - Flashing data

27/001/2017 23:01:18 - INFO - Closing TA partition

27/001/2017 23:01:18 - INFO - Opening TA partition 2

27/001/2017 23:01:18 - INFO - Writing TA unit 0000084F. Value : 1A CE 33 00 01 00 08 03 00 02 04 02 05 00 02 02 10 00 10 05 00 01 03 02 00 10 05 00 04 83 03 00 10 02 00 04 85 05 00 03 03 03 00 10 05 00 05 83 02 00 10 02 00 05 85 12 00 02 00 A9 09 BE BA A9 09 00 00 B3 08 BE BA B3 08 00 00 04 00 03 00 02 00 04 00 04 00 B0 04 0E 00 06 00 B8 0B 01 4B 00 00 00 03 96 00 2C 01 03 00 09 00 01

27/001/2017 23:01:18 - INFO - Writing TA unit 000008FD. Value : 00

27/001/2017 23:01:18 - INFO - Closing TA partition

27/001/2017 23:01:18 - INFO - Opening TA partition 2

27/001/2017 23:01:18 - INFO - Processing keymaster_S1_Boot_MSM8996_LA2_0_N_110_AID_4_PLATFORM-TONE-COM-LIVE-HWID009470E1-SWID0C-APPID01-OEM1-AID4-DEBUG00_S1-BOOT-LIVE-DE8D-0004-MMC.sin

27/001/2017 23:01:18 - INFO - Checking header

27/001/2017 23:01:18 - INFO - Flashing data

27/001/2017 23:01:19 - INFO - Processing pmic_S1_Boot_MSM8996_LA2_0_N_110_AID_4_PLATFORM-TONE-COM-LIVE-HWID009470E1-SWID16-OEM1-AID4-DEBUG00_S1-BOOT-LIVE-DE8D-0004-MMC.sin

27/001/2017 23:01:19 - INFO - Checking header

27/001/2017 23:01:19 - INFO - Flashing data

27/001/2017 23:01:19 - INFO - Processing rpm_S1_Boot_MSM8996_LA2_0_N_110_AID_4_PLATFORM-TONE-COM-LIVE-HWID009470E1-SWID0A-OEM1-AID4-DEBUG00_S1-BOOT-LIVE-DE8D-0004-MMC.sin

27/001/2017 23:01:19 - INFO - Checking header

27/001/2017 23:01:19 - INFO - Flashing data

27/001/2017 23:01:19 - INFO - Processing s1sbl_S1_Boot_MSM8996_LA2_0_N_110_AID_4_S1-BOOT-LIVE-DE8D-0004-ELF_S1-BOOT-LIVE-DE8D-0004-MMC.sin

27/001/2017 23:01:19 - INFO - Checking header

27/001/2017 23:01:19 - INFO - Flashing data

27/001/2017 23:01:20 - INFO - Processing tzs1attest_S1_Boot_MSM8996_LA2_0_N_110_AID_4_PLATFORM-TONE-COM-LIVE-HWID009470E1-SWID0C-APPID01-OEM1-AID4-DEBUG00_S1-BOOT-LIVE-DE8D-0004-MMC.sin

27/001/2017 23:01:20 - INFO - Checking header

27/001/2017 23:01:20 - INFO - Flashing data

27/001/2017 23:01:21 - INFO - Processing tz_S1_Boot_MSM8996_LA2_0_N_110_AID_4_PLATFORM-TONE-COM-LIVE-HWID009470E1-SWID07-OEM1-AID4-DEBUG00_S1-BOOT-LIVE-DE8D-0004-MMC.sin

27/001/2017 23:01:21 - INFO - Checking header

27/001/2017 23:01:21 - INFO - Flashing data

27/001/2017 23:01:21 - INFO - Processing tzs1sbl_S1_Boot_MSM8996_LA2_0_N_110_AID_4_PLATFORM-TONE-COM-LIVE-HWID009470E1-SWID0C-APPID01-OEM1-AID4-DEBUG00_S1-BOOT-LIVE-DE8D-0004-MMC.sin

27/001/2017 23:01:21 - INFO - Checking header

27/001/2017 23:01:21 - INFO - Flashing data

27/001/2017 23:01:22 - INFO - Processing xbl_S1_Boot_MSM8996_LA2_0_N_110_AID_4_PLATFORM-TONE-COM-LIVE-HWID009470E1-SWID00-OEM1-AID4-DEBUG00_S1-BOOT-LIVE-DE8D-0004-MMC.sin

27/001/2017 23:01:22 - INFO - Checking header

27/001/2017 23:01:22 - INFO - Flashing data

27/001/2017 23:01:24 - INFO - Closing TA partition

27/001/2017 23:01:24 - INFO - Opening TA partition 2

27/001/2017 23:01:24 - WARN - apps_log is excluded from bundle

27/001/2017 23:01:24 - WARN - diag is excluded from bundle

27/001/2017 23:01:24 - WARN - ssd is excluded from bundle

27/001/2017 23:01:24 - WARN - adspso is excluded from bundle

27/001/2017 23:01:24 - INFO - Processing cache.sin

27/001/2017 23:01:24 - INFO - Checking header

27/001/2017 23:01:24 - INFO - Flashing data

27/001/2017 23:01:24 - INFO - Processing modem.sin

27/001/2017 23:01:24 - INFO - Checking header

27/001/2017 23:01:24 - INFO - Flashing data

27/001/2017 23:01:27 - WARN - Qnovo is excluded from bundle

27/001/2017 23:01:27 - INFO - Processing amss_fs_1.sin

27/001/2017 23:01:27 - INFO - Checking header

27/001/2017 23:01:27 - INFO - Flashing data

27/001/2017 23:01:27 - INFO - Processing amss_fs_2.sin

27/001/2017 23:01:27 - INFO - Checking header

27/001/2017 23:01:27 - INFO - Flashing data

27/001/2017 23:01:28 - INFO - Processing amss_fsg.sin

27/001/2017 23:01:28 - INFO - Checking header

27/001/2017 23:01:28 - INFO - Flashing data

27/001/2017 23:01:28 - WARN - persist is excluded from bundle

27/001/2017 23:01:28 - INFO - Processing kernel.sin

27/001/2017 23:01:28 - INFO - Checking header

27/001/2017 23:01:28 - INFO - Flashing data

27/001/2017 23:01:30 - INFO - Processing fotakernel.sin

27/001/2017 23:01:30 - INFO - Checking header

27/001/2017 23:01:30 - INFO - Flashing data

27/001/2017 23:01:32 - INFO - Processing ramdump.sin

27/001/2017 23:01:32 - INFO - Checking header

27/001/2017 23:01:32 - INFO - Flashing data

27/001/2017 23:01:34 - INFO - Processing system.sin

27/001/2017 23:01:34 - INFO - Checking header

27/001/2017 23:01:34 - INFO - Flashing data

27/003/2017 23:03:29 - INFO - Closing TA partition

27/003/2017 23:03:29 - INFO - Opening TA partition 2

27/003/2017 23:03:29 - INFO - Processing oem.sin

27/003/2017 23:03:29 - INFO - Checking header

27/003/2017 23:03:29 - INFO - Flashing data

27/003/2017 23:03:32 - WARN - userdata is excluded from bundle

27/003/2017 23:03:32 - INFO - Closing TA partition

27/003/2017 23:03:32 - INFO - Opening TA partition 2

27/003/2017 23:03:32 - WARN - Unit 2212 not found in bundle

27/003/2017 23:03:32 - INFO - Closing TA partition

27/003/2017 23:03:32 - INFO - Opening TA partition 2

27/003/2017 23:03:32 - WARN - Unit 2404 not found in bundle

27/003/2017 23:03:32 - INFO - Closing TA partition

27/003/2017 23:03:32 - INFO - Opening TA partition 2

27/003/2017 23:03:32 - WARN - Unit 2486 not found in bundle

27/003/2017 23:03:32 - INFO - Closing TA partition

27/003/2017 23:03:32 - INFO - Opening TA partition 2

27/003/2017 23:03:32 - WARN - Unit 2311 not found in bundle

27/003/2017 23:03:32 - INFO - Closing TA partition

27/003/2017 23:03:32 - INFO - Opening TA partition 2

27/003/2017 23:03:32 - WARN - Unit 2330 not found in bundle

27/003/2017 23:03:32 - INFO - Closing TA partition

27/003/2017 23:03:32 - INFO - Opening TA partition 2

27/003/2017 23:03:32 - WARN - Unit 2550 not found in bundle

27/003/2017 23:03:32 - INFO - Closing TA partition

27/003/2017 23:03:32 - INFO - Opening TA partition 2

27/003/2017 23:03:32 - WARN - Unit 2553 not found in bundle

27/003/2017 23:03:32 - INFO - Closing TA partition

27/003/2017 23:03:32 - INFO - Opening TA partition 2

27/003/2017 23:03:32 - INFO - Processing elabel.sin

27/003/2017 23:03:32 - INFO - Checking header

27/003/2017 23:03:32 - INFO - Flashing data

27/003/2017 23:03:33 - INFO - Closing TA partition

27/003/2017 23:03:33 - INFO - Opening TA partition 2

27/003/2017 23:03:33 - INFO - Writing TA unit 00002725. Value : 32 30 31 37 2D 30 33 2D 32 37 20 32 33 3A 30 33 3A 33 33 00

27/003/2017 23:03:33 - INFO - Writing TA unit 00002774. Value : 00

27/003/2017 23:03:33 - INFO - Closing TA partition

27/003/2017 23:03:34 - INFO - Ending flash session

27/003/2017 23:03:34 - INFO - Flashing finished.

27/003/2017 23:03:34 - INFO - Please unplug and start your phone

27/003/2017 23:03:34 - INFO - For flashtool, Unknown Sources and Debugging must be checked in phone settings

My issue now arises when I install TWRP. Im installing TWRP version 3.1.0-0, which is the newest version. The problem Im experiencing is also happening when installing older versions as well. I am flashing TWRP using fastboot. It installs and boots into TWRP. Once Im in TWRP and reboot my device, I get the (RED) Your device is corrupt and cannot be trusted, logo. From this screen my device fails to boot into the OS. Its dead in the water right there. Doing a hard reset I can boot back into TWRP. When in TWRP, I again attempt to reboot the system. Again, the same outcome. I am also unable to restore my back up files to get my device operational again, because I am met with the same (RED) error and my device will not boot.

Now, at this point I must flash the stock firmware again in order to boot my device. Once the firmware is reflashed, I have zero issues. I have downloaded TWRP directly from them, so I don't understand how or why the files could be corrupted to the point my device will not boot unless TWRP is not installed.

This is driving me crazy as my only wish is to root this damn phone, run on a stable ROM that is clean and free of bloatware. I just want a fast, clean, stable running Xperia smartphone with the ability to do minor tweaks. (or major if i so choose)

Any help or ideas anyone has about this issue will be GREATLY appreciated!