HTC One M7 Stock ROM Installation My HTC One M7 phone is S-OFF, has the latest firmware 7.19.401.2, and has nicely installed "ViperOne+9.0.0-fix", the Recovery is TWRP 2.8.6.0.
Everything works very well, except that the proximity sensor seems erratic, and when I have a call the ear seems to press different programs on the touch-screen.

I would like to return to complete HTC Stock ROM, so that I assure myself the proximity sensor works well enough (or does not).
Do I have to downgrade the firmware to be able to install the Stock ROM?
I have downloaded, but seem to be unable to install, from TWRP the Stock ROM:
PN07IMG_M7_UL_L50_SENSE60_MR_HTC_Europe_7.19.401.2_Radio_4T.35.3218.16_10.33Q.1718.01L_release_421790_signed.zip

Or maybe the only way is via fastboot? With the commands:
1.) htc_fastboot oem rebootRUU
2.) htc_fastboot flash zip RUU.zip
3.) htc_fastboot reboot-bootloader

Can someone more experienced give an advice, please?
OK so I have a One m8 but I think the process should be about the same. You'll want to find the right RUU for your model. I'm not certain which model/carrier you have so here is an overview list: http://forum.xda-developers.com/showthread.php?t=2428276. 

To relock your bootloader (necessary for RUU), make sure you have adb installed, connect your phone to your PC. Then type the following commands:

adb devices
adb shell
su
echo -ne ‘\x00\x00\x00\x00’ | dd of=/dev/block/mmcblk0p2 bs=1 seek=33796
exit
exit
adb reboot bootloader


When that is done, simply run the RUU exe that you downloaded from the first link. If you found the right one, it should restore your phone completely to stock.