I’m having a similar/related problem (same error message) but without using IFrames.
In my case I’m using standard email/password authentication. Whenever a logged-in user disconnects from the RC server and then reconnects, the client attempts to log the user in again immediately after the reconnect using the login token in the browser’s localStorage (if one exists).
If there is an error during that auto-login process, the user will not be logged in. If they were previously logged in, they will be logged out (which is what’s happening in my case - the user who was previously logged in is sometimes getting logged out immediately after reconnecting).
I’ve been looking into the source code for the accounts-base package which handles all the common auth logic. I’ll reply here when I find the cause of the issue since there’s a good chance it will be the same solution for you.