Recover nexus 5x with locked bootloader and TWRP
Both locking and unlocking bootloader performs a factory reset on your device on the next boot. This wiping needs stock recovery. You had installed TWRP to the device and since you locked back bootloader. It needed the default recovery to be able to wipe it, since it wasn't there, TWRP tries to wipe, boot and fail, back to TWRP on and on forever. Flashing stock recovery either via fastboot, or flasing software will help it reset hence boot again. If you feel new to this. You can request a full more detailed answer from me and I'll edit this to your convenience.

Note: Flashing software will always download in firmware regardless of the state of that checkbox