Screen flickers when pressing on/off button after start up
I have just replaced the screen and battery on my friends Huawei P9. Once I boot the phone up everything looks great. I get the startup logo and then the home screen displays. However, once the display goes to sleep if I press the on/off button to wake the phone the screen does not respond properly. I press the button and the screen flashes quickly/flickers and wont respond to any input. The only way I can get it to work properly is to hard rest the device, but then the error returns again once the phones display goes to sleep.
While I was trying to fix it, I inadvertently launched the camera app just using the side buttons. Once I backed out of this app (I think I pressed the on/off button, I cant remember) the screen worked again and now displays correctly. It now responds to normal button presses etc. The problem has not returned since, but im worried it might come back.
Can anyone explain what happened, or what to do if this problem returns again. Is it a firmware issues? Or an issue with installing the new components? Are the Buttons on the way out?