I bought a used nexus 5x and got a message saying to lock the bootloader to allow OTA updates. So I did, not fully understanding what my situation was. It wiped the phone and now it won't boot. I can get into TWRP but that's it.
I tried loading a bullhead factory image (as well as a lineage zip) on a USB-C flash drive from the TWRP install menu but it failed with error 7.
I'm not really sure what to do now. Is there any way I can get my phone flashed with a working image? Ideally the factory image.
edit: I should add that I tried the standard flashing instructions but they all start with unlocking with fastboot which doesn't work apparently because i need to check a box in the unbootable OS.
update:
Well, for some reason poking the clear cache button in TWRP fixed it and it booted, I was then able to unlock the boot loader and install the factory rom. Not sure how to evaluate the answers now as I can't test them.