So i have been having the same issues (at around 30-40%, a low battery warning would pop up and the phone would shut down) and tried the path of contacting Google Support. I had purchased my phone from the online Google Store mind you. They were extremely helpful, first having me try some steps to see if the issue could be resolved (different settings tweaks, Safe Mode, and then a factory reset), which of course did not solve the problem as i knew it wouldn't. After i replied back stating that i tried these things, they simply sent me a link to a new replacement device (32gb Pixel XL since they are apparently out of 6Ps?). By tomorrow or Thursday, I should have a brand new device to replace an almost 2 year old phone. Now THAT is customer service. Good on ya Google!
If you purchased your 6P direct from Google, i'd recommend you go the route of contacting them about your battery issues. They will replace your declining 6P with a brand new Pixel XL which is as good as it could get (though i did really like the 6P... hopefully the Pixel XL is just as good). Good luck!