it is a bug that was introduced in 7.1.1 update. This problem has been described in several topics in this forum. So far we have not found a solution, and no solution has been provided by Nokia either.
We have figured out that it happens if you use the camera. If you don't - the phone works OK.
So far the only option is to reboot the phone when it stops responding: press power button and volume up button simultaneously for some 10 seconds, and the phone will restart.
I have found a temporary work-around this. If I switch off and restart my phone after using the camera then it keeps working. Turning off the phone when I sleep instead of leaving it inactive also helps. Hope this works temporarily for you guys too!
Yes I had this common enough problem with my Nokia 3. However, since upgrading to Android Oreo beta the problem has not occurred again. Prior to upgrading from 7.1.1, I was getting the Nokia 3 powering itself off at least twice a day and always when I plugged in the USB charger cable regardless of the actual battery charge.
I used the OTA upgrade from 7.1.1 to Oreo 8.0 beta 15 days ago and have been unable to reproduce the problem since then.