Had the same experience after booting into TWRP 3.5.0-0-rav-sofia.img via fastboot on my Moto G Power XT2041-4 (sofia) phone. When I attempted to boot back to system, because of the inverted touch screen issue, the active partition was changed from A to B. The phone became unbootable

. Had to flash the stock rom again.
I was wondering if someone with a bit of expertise could have a look at the code and come up with a fix for the inverted touchscreen issue

. It would be very much appreciated for those who would like a properly working TWRP recovery on this phone. Thanks in advance....