I had this problem after changing out a battery. When I pressed on the screen the phone would shut off and wouldn’t restart until I plugged it in. I thought it was a bad battery but it turns out that a the little metal box on the back of the screen was making contact with another metal part on the phone body. I put a piece of packing tape over the metal box (not sure what it’s called) and that solved the problem. I’m no expert but it seems like this problem is a result of metal pieces making contact and causing the phone to short circuit and shut down.