Why do you sometimes have to press the device rotation tile twice for it to function? I have a auto rotate quick tile  which was originally on stock Android on my Nexus 6p running Android 7.1.2 nougat. I realized that in some cases, after I press the autorotate tile to change from portrait mode to auto-rotate or vice-versa, it doesn't change and instead stays at what it was before (auto rotate or portrait) until I press the tile again. This occurrence seems to be random and at other times the tile works perfectly normally with each press. How do I make it so that this tile works with one press every time?
When you tap that button, what is actually happening is a settings file in the phone is updated. If it isn't working on the first tap, it's either caused by lag, or an issue with the quicksetting pane itself. There isn't much you can do as far as a real solution besides a factory reset or using a custom ROM.