I have seen many help posts about hard brick of z2 while playing with custom roms.
So i am gonna make this guide.
If your phone doesn't respond to any key. When you press power key just little vibrate and led flash. When connecting to pc if your phone is shown as 900E mode in device manager then this guide gonna help.
First completely power off your phone.
To do this "Press the power key for 10-15 second, lil vibration and led flashes. Keep pressing till 2nd vibration. Then immediately leave power button."
Now phone is complete switched off.
Then the hard part comes. Taking phone to 9008 mode. 9008 mode is emergency download mode (edl).
Without taking to 9008 mode we cant flash the rom. So its must be taken to 9008 mode
To take phone to 9008 mode you should cut the outer cover of cable.
Strip the data cable so that we can see the inner wires. There you can see 4 wires. Cut the outer skin of green and black wires so that we can see the inner conducting part. Then short circuit them. Make sure both wires touch each
If you dont want to cut inner wires take a thin needle. Pierce green and black wire with needle. Make sure needle touch inner region of both wire.
Now make sure that your phone is completely off. Then its time to connect to the pc.
Make sure both wire are touched properly. Then connect the usb to pc. (Only connect in USB 2.0 PORT). No sound comes if done properly. Pc wont recognize till now.
After about 4 seconds separate green and black cable.
If you using needle then pull out the needle.
If you have been successful phone goes to deep flash mode that is 9008 mode.
If it goes to 900E mode. Keep those wires touched. Keep mobile connected to pc. And power off the phonei.e pressing power buttom for long second till vibrations.
Then after 3-4 second after power off untouch both wires. Itll go to 9008.
If successful then you can flash easily via Miflash. Miflash gives hello packet error. Restart pc, change USB port, take phone out if edl by long pressing power and again take back to edl.