Joining and leaving MUCs is based on your presence. So I shouldn't have been surprised that becoming invisible made me leave all the MUCs I was in; but I was. I imagine a normal person would be even more surprised.
We could try to be smarter about the privacy list we use, adding action='allow' rules for presence-out for the MUCs we're in, modifying it when we join/leave MUCs. (XEP-0126 makes no mention of MUCs whatsoever.)
In XEP-0186, it's slightly up to the server… The XEP says that “When the client enters invisible mode in the midst of a presence session (i.e., after having previously sent undirected presence with no 'type' attribute), the server MUST send <presence type='unavailable'/> presence from the specified resource to all contacts who would receive unavailable presence if the client sent <presence type='unavailable'/>.”, which presumably includes MUCs. But it also says that, while invisible, the server “MUST deliver directed presence stanzas generated by the client.” which allows the user to *join* MUCs while invisible. (Again, no explicit mention of MUCs is made.)
I posted <http://mail.jabber.org/pipermail/jdev/2011-February/088648.html> about this.