A) you still have your own /persist (that came with your specific phone, didn't overwrite it with one from the forums and didn't save your original somewhere) AND
B) all sensors still work (only the fingerprint scanner is broken) AND
C) that you have NEVER ran the hidden fingerprint calibration tools accessible from *#808# (unless you have a backup of /persist from before you did that)
Follow these simple instructions and enjoy:
You can ignore the entire part about having to run the MSM tool to roll back to a previous version of OOS (Step 2). Therefore, no data is lost, no factory reset is required, etc.
Also in very first part of Step 4, you need to dial *#808#, not *#801#
It took me less than 15 minutes and now it's good as new!!! Please give the OP thanks! He spent almost 200 hours figuring this out (and I don't doubt it; I must have spent easily over 20 hours myself and didn't get anywhere...). All I did was find his genius instructions and post them here.
Edit: And to add one last step to the guide, after you finish and get the fp scanner working again, please be sure to take a backup of your now fixed persist partition and store it in at least two different locations. Because if you are reading this, you are most likely modding your phone with at least Magisk (why else unlock the bootloader? ;) and almost anything can cause persist to be corrupted. For me, it was simply installing a bad build of magisk canary back in May that did it. It's not just important for those installing aftermarket ROMs. It's vital for anyone who even thinks about unlocking the bootloader on this device. Because even the act of relocking the bootloader has caused persist to be corrupted for some...
Edit2: If you run the MSM tool after fixing persist, or manually relock the bootloader, you'll wind up with your FP being broken again. I'm assuming because the checksum of the "fixed" persist doesn't match that of the original, unmodified persist, so it gets marked as corrupt again. So you'll need to unlock the bootloader and restore/flash your backed up, fixed persist (you did back it up this time, right? ;) Impossible to run msm tool to get back to stock AND have FP working. Bootloader must be unlocked after using msm tool and fixed persist restored.