If it works when it's plugged in, the most logical explanation would be a battery issue. Perhaps the voltage drops too low when unplugged because the battery is too old.
For future, I recommend limiting charging to less than 100%. Even charging to 95% gives your battery about 150% longevity. It goes like this:
100% - 1x longevity
95% - 1.5x
90% - 2x
80% - 3x
The best way to do it is by rooting your phone and installing the app Battery Charge Limit. An easier way is using the app AccuBattery to alert you when it's time to unplug the charger. But with the root app, it turns off charging on its own and reportedly works with Samsung, Pixel and Nexus phones, and many more (using it personally on the Nexus 5X).
crwdns2934105:0crwdne2934105:0
crwdns2934113:0crwdne2934113:0
crwdns2915270:0crwdne2915270:0
crwdns2889612:0crwdne2889612:0
0
Thanks! I didn't know about the partial charge extending the lifespan. I'll give it a shot. Regarding the power button issue, I'll post again once the new unit is in. So stoked on these genuine Google parts!
crwdns2934271:0crwdnd2934271:0 Daniel Iwama crwdne2934271:0