[Android Q&A, Help & Troubleshooting] Mr /dev/null:
After flashing TWRP version 3.7.0_9.0-poplar, and waiting for "Your device has been unlocked and can't be trusted." message to disappear it displays "Your device has been unlocked and the boot image is not working".

How have I flashed TWRP:

# NOTE: I am using Arch Linux as the host, not windows adb installed from official repositories.
adb reboot bootloader
fastboot oem unlock 0x################ (I have blackout unlock code)
# Restarted and seted up device again, OEM unlocked is enabled in settings + USB debugging
adb reboot bootloader
fastboot flash boot twrp-3.7.0_9-0-poplar.img

After flashing finished and phone being restarted I encountered the message above.

So far I have tried to:

Boot into recovery mode. Power button + Volume Down, the same result except now I have SONY logo for around 5 seconds.

Using ADB to boot into recovery. "adb wait-for-device" doesn't work and never sees the device.

Also when plugged into a computer green light appears in left top corner of phone and also it won't react to any buttons like Power and Volume Up/Down. But Power + Volume Up (completely turn off device) is an exception and it still works.

I think TWRP was corrupted when transferring probably because I have two cables and probably grabbed the one which likes to on random stop transferring data :oops:

Is there a way to flash original boot or repair this phone?

EDIT: Okay so I managed to enable fastboot mode. But I can't find stock Boot/ROM.

EDIT 2: Finally created ftf image using Flashtool using files downloaded using XperiFirm. Now the issue is when entering flashmode (Volume Down + Power [NOT fastboot]), green light indicator lights up for ~4.5 seconds then for 2 seconds it turns off and cycle repeats for ever until I unplug the cable. Also when just plugging cable without pressing Vol- the result is the same. If flashmode doesn't work is there a workaround to use fastboot to flash ftf file? Also when I enter fastboot mode and try to get unlock ability I get an error:

$ fastboot flashing get_unlock_ability
FAILED (remote: 'unknown command')
fastboot: error: Command failed

(Seems like Experia XZ is refusing to execute the command, but I can still flash anything I want onto it using "fastboot flash name file")

EDIT 3: Okay so using Sin extractor in flash tool I have extracted contents form kernel_S1-SW-LIVE-DE8D-PID1-0007-MMC.sin and flashed it as boot and... it works!, but also no. Because when I was messing with this phone I also have flashed something to recovery and oem partitions and I don't know what .sin files correspond to those partitions, below I provide list of files download by ExpriFirm for Experia XZ (F8331)

F8331_Orange MCV FR-ES-PL-SK-RO_41.3.A.2.192-R9E:

Folders:
boot

Sin Files:
adspso_S1-SW-LIVE-DE8D-PID1-0007-MMC.sin
amss_fs_1_S1-MODEMSW-LIVE-DE8D-PID1-0007-MMC.sin
amss_fs_2_S1-MODEMSW-LIVE-DE8D-PID1-0007-MMC.sin
amss_fsg_S1-MODEMSW-LIVE-DE8D-PID1-0007-MMC.sin
apps_log_S1-SW-LIVE-DE8D-PID1-0007-MMC.sin
cache_S1-SW-LIVE-DE8D-PID1-0007-MMC.sin
diag_S1-SW-LIVE-DE8D-PID1-0007-MMC.sin
elabel-F8331-row-row_201804120243693.1_41.3.A.2.149_S1-ELABEL-LIVE-DE8D-PID1-0004-MMC.sin
fotakernel_S1-SW-LIVE-DE8D-PID1-0007-MMC.sin
kernel_S1-SW-LIVE-DE8D-PID1-0007-MMC.sin
modem_S1-MODEMSW-LIVE-DE8D-PID1-0007-MMC.sin
oem_S1-CUST-LIVE-DE8D-PID1-0004-MMC.sin
partition-image_S1-SW-LIVE-DE8D-PID1-0007-MBR.sin
persist_S1-SW-LIVE-DE8D-PID1-0007-MMC.sin
Qnovo_S1-SW-LIVE-DE8D-PID1-0007-MMC.sin
ramdump_S1-SW-LIVE-DE8D-PID1-0007-MMC.sin
ssd_S1-SW-LIVE-DE8D-PID1-0007-MMC.sin
system_S1-SW-LIVE-DE8D-PID1-0007-MMC.sin
userdata_S1-CUST-LIVE-DE8D-PID1-0004-MMC.sin

XML Files:
fwinfo.xml
update.xml

TA Files:
auto-boot.ta
cust-reset.ta
fota-reset.ta
master-reset.ta
osv-restriction.ta
reset-kernel-cmd-debug.ta
reset-non-secure-adb.ta
reset-wipe-reason.ta
simlock.ta

F8331_Orange MCV FR-ES-PL-SK-RO_41.3.A.2.192-R9E/boot

SIN Files:
cmnlib_S1_Boot_MSM8996_LA2_0_O_204_AID_1_TONE-TEST-HWID009470E1-SWID0C-APPID01-OEM0-AID1-DEBUG00_S1-BOOT-TEST-B316-0001-MMC.sin
cmnlib_S1_Boot_MSM8996_LA2_0_O_204_AID_4_PLATFORM-TONE-COM-LIVE-HWID009470E1-SWID0C-APPID01-OEM1-AID4-DEBUG00_S1-BOOT-LIVE-DE8D-0004-MMC.sin
cmnlib_S1_Boot_MSM8996_LA2_0_O_204_AID_4_PLATFORM-TONE-LIVE-HWID009470E1-SWID0C-APPID01-OEM1-AID4-DEBUG00_S1-BOOT-LIVE-DE8D-0004-MMC.sin
devcfg_S1_Boot_MSM8996_LA2_0_O_204_AID_1_TONE-TEST-HWID009470E1-SWID05-OEM0-AID1-DEBUG00_S1-BOOT-TEST-B316-0001-MMC.sin
devcfg_S1_Boot_MSM8996_LA2_0_O_204_AID_4_PLATFORM-TONE-COM-LIVE-HWID009470E1-SWID05-OEM1-AID4-DEBUG00_S1-BOOT-LIVE-DE8D-0004-MMC.sin
devcfg_S1_Boot_MSM8996_LA2_0_O_204_AID_4_PLATFORM-TONE-LIVE-HWID009470E1-SWID05-OEM1-AID4-DEBUG00_S1-BOOT-LIVE-DE8D-0004-MMC.sin
emmc_appsboot_S1_Boot_MSM8996_LA2_0_O_204_AID_1_TONE-TEST-HWID009470E1-SWID09-OEM0-AID1-DEBUG00_S1-BOOT-TEST-B316-0001-MMC.sin
emmc_appsboot_S1_Boot_MSM8996_LA2_0_O_204_AID_4_PLATFORM-TONE-COM-LIVE-HWID009470E1-SWID09-OEM1-AID4-DEBUG00_S1-BOOT-LIVE-DE8D-0004-MMC.sin
emmc_appsboot_S1_Boot_MSM8996_LA2_0_O_204_AID_4_PLATFORM-TONE-LIVE-HWID009470E1-SWID09-OEM1-AID4-DEBUG00_S1-BOOT-LIVE-DE8D-0004-MMC.sin
hyp_S1_Boot_MSM8996_LA2_0_O_204_AID_1_TONE-TEST-HWID009470E1-SWID15-OEM0-AID1-DEBUG00_S1-BOOT-TEST-B316-0001-MMC.sin
hyp_S1_Boot_MSM8996_LA2_0_O_204_AID_4_PLATFORM-TONE-COM-LIVE-HWID009470E1-SWID15-OEM1-AID4-DEBUG00_S1-BOOT-LIVE-DE8D-0004-MMC.sin
hyp_S1_Boot_MSM8996_LA2_0_O_204_AID_4_PLATFORM-TONE-LIVE-HWID009470E1-SWID15-OEM1-AID4-DEBUG00_S1-BOOT-LIVE-DE8D-0004-MMC.sin
keymaster_S1_Boot_MSM8996_LA2_0_O_204_AID_1_TONE-TEST-HWID009470E1-SWID0C-APPID01-OEM0-AID1-DEBUG00_S1-BOOT-TEST-B316-0001-MMC.sin
keymaster_S1_Boot_MSM8996_LA2_0_O_204_AID_4_PLATFORM-TONE-COM-LIVE-HWID009470E1-SWID0C-APPID01-OEM1-AID4-DEBUG00_S1-BOOT-LIVE-DE8D-0004-MMC.sin
keymaster_S1_Boot_MSM8996_LA2_0_O_204_AID_4_PLATFORM-TONE-LIVE-HWID009470E1-SWID0C-APPID01-OEM1-AID4-DEBUG00_S1-BOOT-LIVE-DE8D-0004-MMC.sin
pmic_S1_Boot_MSM8996_LA2_0_O_204_AID_1_TONE-TEST-HWID009470E1-SWID16-OEM0-AID1-DEBUG00_S1-BOOT-TEST-B316-0001-MMC.sin
pmic_S1_Boot_MSM8996_LA2_0_O_204_AID_4_PLATFORM-TONE-COM-LIVE-HWID009470E1-SWID16-OEM1-AID4-DEBUG00_S1-BOOT-LIVE-DE8D-0004-MMC.sin
pmic_S1_Boot_MSM8996_LA2_0_O_204_AID_4_PLATFORM-TONE-LIVE-HWID009470E1-SWID16-OEM1-AID4-DEBUG00_S1-BOOT-LIVE-DE8D-0004-MMC.sin
rpm_S1_Boot_MSM8996_LA2_0_O_204_AID_1_TONE-TEST-HWID009470E1-SWID0A-OEM0-AID1-DEBUG00_S1-BOOT-TEST-B316-0001-MMC.sin
rpm_S1_Boot_MSM8996_LA2_0_O_204_AID_4_PLATFORM-TONE-COM-LIVE-HWID009470E1-SWID0A-OEM1-AID4-DEBUG00_S1-BOOT-LIVE-DE8D-0004-MMC.sin
rpm_S1_Boot_MSM8996_LA2_0_O_204_AID_4_PLATFORM-TONE-LIVE-HWID009470E1-SWID0A-OEM1-AID4-DEBUG00_S1-BOOT-LIVE-DE8D-0004-MMC.sin
s1sbl_S1_Boot_MSM8996_LA2_0_O_204_AID_1_TONE-S1-BOOT-TEST-B316-0001-MMC.sin
s1sbl_S1_Boot_MSM8996_LA2_0_O_204_AID_4_S1-BOOT-LIVE-DE8D-0004-ELF_S1-BOOT-LIVE-DE8D-0004-MMC.sin
tzs1attest_S1_Boot_MSM8996_LA2_0_O_204_AID_1_TONE-TEST-HWID009470E1-SWID0C-APPID01-OEM0-AID1-DEBUG00_S1-BOOT-TEST-B316-0001-MMC.sin
tzs1attest_S1_Boot_MSM8996_LA2_0_O_204_AID_4_PLATFORM-TONE-COM-LIVE-HWID009470E1-SWID0C-APPID01-OEM1-AID4-DEBUG00_S1-BOOT-LIVE-DE8D-0004-MMC.sin
tzs1attest_S1_Boot_MSM8996_LA2_0_O_204_AID_4_PLATFORM-TONE-LIVE-HWID009470E1-SWID0C-APPID01-OEM1-AID4-DEBUG00_S1-BOOT-LIVE-DE8D-0004-MMC.sin
tz_S1_Boot_MSM8996_LA2_0_O_204_AID_1_TONE-TEST-HWID009470E1-SWID07-OEM0-AID1-DEBUG00_S1-BOOT-TEST-B316-0001-MMC.sin
tz_S1_Boot_MSM8996_LA2_0_O_204_AID_4_PLATFORM-TONE-COM-LIVE-HWID009470E1-SWID07-OEM1-AID4-DEBUG00_S1-BOOT-LIVE-DE8D-0004-MMC.sin
tz_S1_Boot_MSM8996_LA2_0_O_204_AID_4_PLATFORM-TONE-LIVE-HWID009470E1-SWID07-OEM1-AID4-DEBUG00_S1-BOOT-LIVE-DE8D-0004-MMC.sin
tzs1sbl_S1_Boot_MSM8996_LA2_0_O_204_AID_1_TONE-TEST-HWID009470E1-SWID0C-APPID01-OEM0-AID1-DEBUG00_S1-BOOT-TEST-B316-0001-MMC.sin
tzs1sbl_S1_Boot_MSM8996_LA2_0_O_204_AID_4_PLATFORM-TONE-COM-LIVE-HWID009470E1-SWID0C-APPID01-OEM1-AID4-DEBUG00_S1-BOOT-LIVE-DE8D-0004-MMC.sin
tzs1sbl_S1_Boot_MSM8996_LA2_0_O_204_AID_4_PLATFORM-TONE-LIVE-HWID009470E1-SWID0C-APPID01-OEM1-AID4-DEBUG00_S1-BOOT-LIVE-DE8D-0004-MMC.sin
xbl_S1_Boot_MSM8996_LA2_0_O_204_AID_1_TONE-TEST-HWID009470E1-SWID00-OEM0-AID1-DEBUG00_S1-BOOT-TEST-B316-0001-MMC.sin
xbl_S1_Boot_MSM8996_LA2_0_O_204_AID_4_PLATFORM-TONE-COM-LIVE-HWID009470E1-SWID00-OEM1-AID4-DEBUG00_S1-BOOT-LIVE-DE8D-0004-MMC.sin
xbl_S1_Boot_MSM8996_LA2_0_O_204_AID_4_PLATFORM-TONE-LIVE-HWID009470E1-SWID00-OEM1-AID4-DEBUG00_S1-BOOT-LIVE-DE8D-0004-MMC.sin

TA Files:
Kagura_S1BootConfig_MiscTA.ta

XML Files:
boot_delivery.xml

EDIT 4: Also I have egzamined the green light further and it looks like it reboots phone, because when I hold Vol- after green light turn off it will enter fastboot mode. I now know that ROM is located in system.sin, but when I extract the data from it I get ext4 partition which I can mount but I have absolutly no idea how to flash it as Experia XZ complains that file is too big (~5.3GB). Oh and I would almost forgot, I still don't know which .sin file is the recovery one.

EDIT 5: BIG NEWS!!! After unbricking boot partition I was able to install TWRP on recovery. I will get microSD ASAP and I will see what if I can flash stock ROM at least for now.

Thanks in advice for any kind of help!