If you're in a dialog with an NPC or in an NPC store, auto-logout will fail, simply showing the message "Unable to execute command while occupied" when attempting to log you out after being inactive for too long.