I have Kindle 5th generation, model number D01100. I had this problem for few years now and I gave up. Recently I tried to turn it on and to my surprise it worked. Unfortunately after reboot it showed the same message: "Your Kindle needs repair. Please contact Kindle Customer service at kindle.com/support". I don't understand why did it turn on and why is it bricked again. I tried holding power button for 40 seconds but nothing happens. I plugged it to my PC but it is not detected.
Some Kindle users managed to trigger a factory reset using the following steps:
Charge the Kindle for several days (some users did this for a week).
Create an empty text file with the name DO_FACTORY_RESTORE and without any file type extension.
Connect the Kindle via USB and copy the file to the root directory.
Safe eject the Kindle and hold down the power button 40 seconds to trigger a factory reset.
The trick part is having the computer recognize the Kindle. (It might be only be visible in the Windows Explorer for a couple of seconds.)