Android 8.1 Update Found to Cause a Possibly Dangerous Overcharging Bug With the Original Google Pixel XL
Ideally, updates are designed and rolled out to remove bugs, but in the case of Google Pixel and Nexus devices, it seems to be the opposite. There has been a history of major updates and security patches causing bugs on arrival, and the case of Google's 2016 Pixel XL, a new problem was introduced with the Android 8.1 update this January.
When charging in certain circumstances, the Pixel XL will attempt to pull up to 40% more current than the charger is rated to handle, thus repeatedly entering and leaving a charging state as the charger shuts off due to overcurrent protection. So if you've noticed your Pixel XL recently flashing "charging rapidly" multiple times after being plugged into the stock charger, that's why.
The problem seems to get triggered when the stock charger is used. All that's needed is a USB-C PD-compliant charger of the correct wattage and a sufficiently drained battery. When the Pixel XL is plugged in, it should ideally pull up to 18W (9V/2A) from the charger, but in reality, it will attempt to draw up to 25W (9V/2.8A).
Thankfully, the stock charger shuts off when this occurs, interrupting charging before the phone tries again. The cycle of drawing more current than the charger can handle and then shutting off happens for about three to four times before the phone begins to draw a lower value of current.
However, if you're using a non-stock charger that doesn't have overcurrent protection or doesn't adequately meet other aspects of the USB-PD specification, it could be dangerous, potentially damaging your device or worse. While it's possible that not all Pixel XL devices are affected, the specific charger configuration required to trigger the problem might be one explanation for the difference in experience.
The OP of the support thread that first highlighted the problem speculates that the problem stems from faulty battery charge controller logic introduced with the Android 8.1 update.
The bug was initially reported to Google's Issue Tracker back in January, and almost two months on it doesn't seem to have been resolved. Considering that an overcurrent situation like this could be dangerous with anything but a stock charger, we'd have expected it to be fixed by now. In the meantime, Pixel XL owners may want to make sure they stick to known good chargers with overcurrent protection, like the stock one.