In a YouTube video made by user TheRedyTedy, it's showcased that this particular user's Nexus 6P has a tendency to simply shut off at random times for no discernible reason whatsoever. TheRedyTedy replicates the issue in the video by simply taking a handful of photos with the stock Google Camera app, and the phone immediately powers down shortly after this. Once the phone is shut off, TheRedyTedy shows that pressing the power button once and holding it down has no effect on the phone at all - resulting in having no choice but to plug the 6P into the charger, wait for the charging indicator to pop up on the screen, and then turn it back on that way. It's said in the video that the Nexus 6P being used is an RMA, is running a non-beta version of Android 7.0 Nougat, and it's already been through a factory reset.
TheRedyTedy shared this YouTube video on the r/Android subreddit on Sunday, October 30, and it has since generated a ton of comments from other users who are reporting similar issues with their 6P as well. When going through the comments, some users have reported that a factory reset worked in their case, and others are saying that flashing Android 7.1.1 did the trick for them.Then again, one user reported that flashing 7.1.1 was actually the cause of the battery issue for them, so there doesn't currently appear to be any concrete solution for this issue.
One user reported that they contacted Google about the issue, got an RMA, and that the replacement is now working fine for them. If you have a 6P with this issue, trying a factory reset or flashing 7.1.1 could be worth a shot, but it looks like you might not have any other choice but to see if you can get Google to send you a replacement if the problem persists.