I bought a second hand Pixel 2XL and was initially thrilled until I tried plugging it in and realised it was immediately turning itself off - hard and fast. A quick search came across multiple large threads which never had a single reliable "it's because of X" reason - all sort of cargo cult solutions posted but really the device charging port seems to be somewhat fried but no official acknowledgement that's the case from Google.
* https://support.google.com/pixelphone/forum/AAAAb4-OgUsBZo6t...?
* https://support.google.com/pixelphone/forum/AAAAb4-OgUs4rkbD...
In the end I ended up returning the CEX (2nd hand store) phone to Google who then sent a new device to me. Though I was glad to get it sorted in that way (and do love the device itself - when it works, it works great) it really put me off ever wanting to buy new their hardware fresh. Just seems to have way too many problems.
* https://www.reddit.com/r/GooglePixel/comments/cm9dt9/cex_bou...