When you log in on one wiki, then visit another wiki that you've never visited before, the autologin mechanism (whether via resource or top-level) is supposed to create a local account, attach it, then log into it – instead, the account is created and attached, but the login fails with error message "Local user is not attached". The next time autologin is attempted, the account exists, so it works. This could be some sort of a race condition.
I ran into this by chance today while testing a CentralAuth backport. We actually have error logging for the top-level fails, and this happens ~200 times per day: https://logstash.wikimedia.org/goto/6c27772466efa52122ec691c605c05a6