Nexus 5, Marshmallow, and TWRP recovery - Unstable, inaccesible recovery I've got a problem when trying to set up my (two) nexus'es 5. (issue reproducible on both my phones, which kinda excludes hardware issues)

1: I download factory images from google's page (tried all 6.0.1 builds for hammerhead), unpack them, enter bootloader, and flash-all.sh

2: I set up the phone, log in to google, set up USB debugging, and adb reboot bootloader

3: I flash TWRP by fastboot flash recovery twrp-..-hammerhead.img (tried 3.0.0.0 and 2.8.7.0 version)

After that, accessing recovery is night impossible. Sometimes I can enter Recovery mode straight from bootloader. TWRP will launch, but only once. Exiting it, booting up system, and then adb reboot recovery / adb reboot bootloader and from it selecting Recovery will only show google logo with the open padlock icon for a few moments, then the screen will blank, phone will vibrate, the logo+padlock will show again, and from it it will boot system. 

Entering recovery will invariably end with it booting system. 
In this state, flashing recovery from bootloader again will do nothing, only re-flashing factory image will help (but not for long)

Has something changed in 6.0.1? Are there any steps I'm missing when flashing recovery? Am I doing something wrong?
The same thing happened to my Nexus 5 as well,when I upgraded to android M and tried rooting and flashing recovery.The process went perfectly fine but when I tried to enter recovery mode it didn't happen.
For which I tried using the Nexus Root Toolkit,which has several functionalities required.I tried rooting my phone and then flashing the stock recovery,everything worked like a charm for me. So I would suggest you to download the Nexus Root Toolkit by wug fresh then first try to flash the stock ROM again there after Root followed by flashing the custom recovery.