Solution 2 : If TWRP is locked aswell.
This method also cleans and resets your device completely.
Note :Your all data will be lost.
1. Boot into fastboot by holding Vol Down + Power Button.
2. Run all below commands in cmd
#To erase system partition
fastboot erase system
#To erase boot partition
fastboot erase boot
#To erase cache partition
fastboot erase cache
#To erase user data partition
fastboot erase userdata
#To erase recovery partition
fastboot erase recovery
3. After that flash Twrp Recovery file of your device from here.
Run Command
Eg : fastboot flash recovery twrp.img
4. After Twrp flashing, boot into Twrp Recovery by pressing Vol Up + Power Button.
Click on Wipe > Format Data > yes.
5. Now, flash the rom in Twrp Recovery.
6. After flashing the rom, flash DFE *Disable Force Encryption* file.
7. All Done. Kudos.