Everyday government operations are far more expansive than a single CIA enemy government "presto chango" group lol. Planning just about anything takes a lot of work, and there are a lot of ***people*** who do it as a result. These people are just that - people. Miscommunications happen, egos exist, insubordination or incompetence happens, and for as generally competent as (at least in my experience with the IC oriented bits) they are overall, they're not immune from leaving their proverbial fly open every now and again. I'd be quite willing to bet that there was no grand, orchestrated conspiracy behind Pelosi's visit, and that it was much more likely due to Pelosi's own ego, Biden and friends' inadequate political capital to stop her (After all, nothing's free.), and (this one I'm certain of) a DOD that was pretty much just handed the problem and told to make the best of it, good luck.