You mean after unplugging from your car's Android Auto? I've noticed this behavior before, where I take my phone out of my pocket and it asks me for my PIN and then has to boot into the phone again. It is completely random for me and doesn't seem to be related to Android Auto though.
If it's happening after unplugging from Android Auto consistently it may be related.