The Nexus 6P has a known battery problem which does shut off when it hits a lower percentage. I had a 6P and it was annoying, to say the least.
The difference with this story is that this is software and intended, not a bug with a faulty phone/model.