How often does it happen? It can be really hard to troubleshoot issues that only happen once every few weeks or so. If it happens with some frequency, you could boot into Safe Mode and see if the problem persists: https://support.google.com/nexus/answer/2852139?hl=en