Is the power button on my iPhone being turned off programmatically?
I would like to know if there is a code / glitch to make the sleep/wake button on the iPhone 5/5S to stop working. i am almost 100% certain it exists due to some programmers making the code but i want to know if anyone on here knows or heard about it.
The likely cause is hardware failure, and not software.
It is almost certainly a hardware failure. There is known hardware defect with some early iPhone 5 units that causes the sleep/wake button to stop working.
Apple has acknowledged the problem and is offering to repair devices that were manufactured with this defect. You can go to Apple's support site to see if your device qualifies for repair and, if it does, to get instructions for how to get your phone repaired.