[Redmi K20 Pro / Xiaomi Mi 9T Pro Questions & Answe] xdathermoman:
I just hit the exact same problem.

Running LineageOS 16 with TWRP on raphael with firmware from MIUI Global 10.3.1 Stable (PFKEUXM) (the stock firmware installed when I bought the device from amazon.de) I just flashed fw_raphael_miui_RAPHAELEEAGlobal_V10.3.3.0.PFKEUXM_52bd3959c9_9.0.zip in TWRP and then system won't boot anymore.

I just confirmed the files inside fw_raphael_miui_RAPHAELEEAGlobal_V10.3.3.0.PFKEUXM_52bd3959c9_9.0.zip provided by https://xiaomifirmwareupdater.com/firmware/raphael/ are exactly the same as in the 3.3GB ROM file raphael_eea_global_images_V10.3.3.0.PFKEUXM_20190903.0000.00_9.0_eea_1ff82a2c11.tgz:

for i in fw/firmware-update/* ; do sha1sum $i rom/raphael_eea_global_images_V10.3.3.0.PFKEUXM_20190903.0000.00_9.0_eea/images/$(basename $i) ; done
35e221e584c270c464a2a3eab4518635998ffb92 fw/firmware-update/abl.elf
35e221e584c270c464a2a3eab4518635998ffb92 rom/raphael_eea_global_images_V10.3.3.0.PFKEUXM_20190903.0000.00_9.0_eea/images/abl.elf
8e2b1a88accc727b72788304561255dac1a7a0a8 fw/firmware-update/aop.mbn
8e2b1a88accc727b72788304561255dac1a7a0a8 rom/raphael_eea_global_images_V10.3.3.0.PFKEUXM_20190903.0000.00_9.0_eea/images/aop.mbn
c54ef7f35b8047ec62b3b5c94b1380edab6cc3f2 fw/firmware-update/BTFM.bin
c54ef7f35b8047ec62b3b5c94b1380edab6cc3f2 rom/raphael_eea_global_images_V10.3.3.0.PFKEUXM_20190903.0000.00_9.0_eea/images/BTFM.bin
be957fcd348a3ae85d4f267691fe1b7eb4f5aef7 fw/firmware-update/cmnlib64.mbn
be957fcd348a3ae85d4f267691fe1b7eb4f5aef7 rom/raphael_eea_global_images_V10.3.3.0.PFKEUXM_20190903.0000.00_9.0_eea/images/cmnlib64.mbn
5c888e63fa7161f2fc584970c408d5f9c1279771 fw/firmware-update/cmnlib.mbn
5c888e63fa7161f2fc584970c408d5f9c1279771 rom/raphael_eea_global_images_V10.3.3.0.PFKEUXM_20190903.0000.00_9.0_eea/images/cmnlib.mbn
ae113319678e799499b290e3a6056f88003f2357 fw/firmware-update/devcfg.mbn
ae113319678e799499b290e3a6056f88003f2357 rom/raphael_eea_global_images_V10.3.3.0.PFKEUXM_20190903.0000.00_9.0_eea/images/devcfg.mbn
6fdceea663b44bc041b2a67430b381f738ca3ad8 fw/firmware-update/dspso.bin
6fdceea663b44bc041b2a67430b381f738ca3ad8 rom/raphael_eea_global_images_V10.3.3.0.PFKEUXM_20190903.0000.00_9.0_eea/images/dspso.bin
1fcdc16cc534eda707c072ce346680cb1048b800 fw/firmware-update/hyp.mbn
1fcdc16cc534eda707c072ce346680cb1048b800 rom/raphael_eea_global_images_V10.3.3.0.PFKEUXM_20190903.0000.00_9.0_eea/images/hyp.mbn
3ccb6667656dc2c7620254fbdf976473dff9ca2b fw/firmware-update/hypvm.mbn
3ccb6667656dc2c7620254fbdf976473dff9ca2b rom/raphael_eea_global_images_V10.3.3.0.PFKEUXM_20190903.0000.00_9.0_eea/images/hypvm.mbn
56ca14c60c0959af6049df7586b82950917d0084 fw/firmware-update/imagefv.elf
56ca14c60c0959af6049df7586b82950917d0084 rom/raphael_eea_global_images_V10.3.3.0.PFKEUXM_20190903.0000.00_9.0_eea/images/imagefv.elf
7802fd4a0c02aa8e32f871a5d040726311ba37f4 fw/firmware-update/km4.mbn
7802fd4a0c02aa8e32f871a5d040726311ba37f4 rom/raphael_eea_global_images_V10.3.3.0.PFKEUXM_20190903.0000.00_9.0_eea/images/km4.mbn
4d1a92092c11571ec8eec9a3cbe8a5614f8aa6fb fw/firmware-update/logo.img
4d1a92092c11571ec8eec9a3cbe8a5614f8aa6fb rom/raphael_eea_global_images_V10.3.3.0.PFKEUXM_20190903.0000.00_9.0_eea/images/logo.img
ea70b094fe48129c0d6373da366d5da46573a348 fw/firmware-update/NON-HLOS.bin
ea70b094fe48129c0d6373da366d5da46573a348 rom/raphael_eea_global_images_V10.3.3.0.PFKEUXM_20190903.0000.00_9.0_eea/images/NON-HLOS.bin
607e1cc458f64187991efa5026ebd9a2df482c5a fw/firmware-update/qupv3fw.elf
607e1cc458f64187991efa5026ebd9a2df482c5a rom/raphael_eea_global_images_V10.3.3.0.PFKEUXM_20190903.0000.00_9.0_eea/images/qupv3fw.elf
09a20d49f2b91e052dc0cd4d49b26f6c77371141 fw/firmware-update/storsec.mbn
09a20d49f2b91e052dc0cd4d49b26f6c77371141 rom/raphael_eea_global_images_V10.3.3.0.PFKEUXM_20190903.0000.00_9.0_eea/images/storsec.mbn
7d041164995770633aaab4932f34f607c93fc91d fw/firmware-update/tz.mbn
7d041164995770633aaab4932f34f607c93fc91d rom/raphael_eea_global_images_V10.3.3.0.PFKEUXM_20190903.0000.00_9.0_eea/images/tz.mbn
8253609cd85a76c739a4e1432e56ef7a564f966e fw/firmware-update/uefi_sec.mbn
8253609cd85a76c739a4e1432e56ef7a564f966e rom/raphael_eea_global_images_V10.3.3.0.PFKEUXM_20190903.0000.00_9.0_eea/images/uefi_sec.mbn
2ffb43052a1bf48f2328ddb0567d9cbd6678e360 fw/firmware-update/xbl_config.elf
2ffb43052a1bf48f2328ddb0567d9cbd6678e360 rom/raphael_eea_global_images_V10.3.3.0.PFKEUXM_20190903.0000.00_9.0_eea/images/xbl_config.elf
f1bb482c9341bf950c356f35cd0e03291e3f3fa3 fw/firmware-update/xbl.elf
f1bb482c9341bf950c356f35cd0e03291e3f3fa3 rom/raphael_eea_global_images_V10.3.3.0.PFKEUXM_20190903.0000.00_9.0_eea/images/xbl.elf

Above you can see that every file from the firmware zip has the same sha1hash as the corresponding file from the big ROM zip.

So let's just flash the files from fw_raphael_miui_RAPHAELEEAGlobal_V10.3.3.0.PFKEUXM_52bd3959c9_9.0.zip again, this time via fastboot instead of TWRP. Maybe TWRP was the problem.

The get the fastboot commands I used this linux command:

grep package_extract_file META-INF/com/google/android/updater-script | perl -p -e 's#^[^"]+".+/([^"]+)"[^"]+".+/([^"]+)".*$#fastboot flash $2 $1#'

This translates the META-INF/com/google/android/updater-script file into fastboot commands and gives me the following output:

fastboot flash cmnlib64 cmnlib64.mbn
fastboot flash modem NON-HLOS.bin
fastboot flash cmnlib cmnlib.mbn
fastboot flash hyp hyp.mbn
fastboot flash keymaster km4.mbn
fastboot flash hypbak hypvm.mbn
fastboot flash tz tz.mbn
fastboot flash aop aop.mbn
fastboot flash xbl_config xbl_config.elf
fastboot flash bluetooth BTFM.bin
fastboot flash uefisecapp uefi_sec.mbn
fastboot flash imagefv imagefv.elf
fastboot flash qupfw qupv3fw.elf
fastboot flash abl abl.elf
fastboot flash dsp dspso.bin
fastboot flash devcfg devcfg.mbn
fastboot flash storsec storsec.mbn
fastboot flash xbl xbl.elf
fastboot flash cmnlib64bak cmnlib64.mbn
fastboot flash cmnlibbak cmnlib.mbn
fastboot flash keymasterbak km4.mbn
fastboot flash tzbak tz.mbn
fastboot flash aopbak aop.mbn
fastboot flash xbl_configbak xbl_config.elf
fastboot flash uefisecappbak uefi_sec.mbn
fastboot flash qupfwbak qupv3fw.elf
fastboot flash ablbak abl.elf
fastboot flash devcfgbak devcfg.mbn
fastboot flash xblbak xbl.elf
fastboot flash vbmeta vbmeta.img
fastboot flash logo logo.img
fastboot flash dtbo dtbo.img

When running these commands I can see these two errors:

fastboot: error: cannot load 'vbmeta.img': No such file or directory

fastboot: error: cannot load 'dtbo.img': No such file or directory

These two files are missing from fw_raphael_miui_RAPHAELEEAGlobal_V10.3.3.0.PFKEUXM_52bd3959c9_9.0.zip but are referenced in

META-INF/com/google/android/updater-script

[..]
package_extract_file("firmware-update/vbmeta.img", "/dev/block/bootdevice/by-name/vbmeta");
[..]
package_extract_file("firmware-update/dtbo.img", "/dev/block/bootdevice/by-name/dtbo");
[..]

Maybe that's the cause for our problems? [MENTION=6084385]yshalsager[/MENTION]

So I just flashed these two files from raphael_eea_global_images_V10.3.3.0.PFKEUXM_20190903.0000.00_9.0_eea/images directory (where I extracted ROM file raphael_eea_global_images_V10.3.3.0.PFKEUXM_20190903.0000.00_9.0_eea_1ff82a2c11.tgz):

fastboot flash vbmeta vbmeta.img
fastboot flash dtbo dtbo.img

I flashed TWRP again:

fastboot flash recovery twrp-3.3.1-15-raphael-mauronofrio.img

But this still didn't fix it. TWRP was not the problem.

The final solution

Flash the whole 10.3.3.0 ROM without wiping data, using flash_all_except_storage.sh.

I even replaced recovery.img with twrp-3.3.1-15-raphael-mauronofrio.img (you have to modify crclist.txt, use linux command 'crc32' (apt-get install libarchive-zip-perl)), so after flash_all_except_storage.sh was done I could boot into TWRP, wipe system, dalvic, cache and then reinstall LineageOS, Magisk, Gapps, etc.

/data was untouched and still there! But you have to use flash_all_except_storage.sh to prevent userdata being written to the device!

Baseband firmware changed from 1.0.c3-36.0978-0722_2256_3caa35a to 1.0.c3-46.0037-0903_1640_fd9ddeb.