Watching what scenes we do have of the protestors breaching what barriers were set up, it does seem that the mob achieved a sort of "strategic surprise". Whatever the security plan was, it wasn't anywhere near enough to deal with the number of people involved. This will have to be seriously looked into, whether it was just a massive blunder or something else. I expect the head of Capital Police will not be retaining his job in either case.
But once the Capitol Police realize that they don't have anywhere near the numbers necessary to hold the lines they erected, it makes sense to retreat to an inner perimeter to shorten you lines and make them more defensible. Starting at that point though, the LEOs present somehow seem very lackadaisical about the whole thing, and never re-established any other kind of line except at the doors of the senate and house chambers it seems.
Their planning also probably didn't help, in the sense that their contingencies are probably mainly around hypothetical jihadi terrorist threats and lone/pair gunman type of events. You saw they had protocols about how/where to start evacuating congresspeople and staffers to via the underground tunnels that exist. Not that they did a great job of that either given what we know about some members and staff having to barricade in their offices. But in any case the evacuation plan further takes away personnel that might otherwise be used to hold some kind of inner perimeter.
So overall it was the strategic level plan that failed the most I think, not having enough personnel or the right equipment to erect barriers that could effectively be held and kept the mob from the building. From then on there's no point in 4 cops trying to hold a line vs tens to hundreds of people, especially if the line has already been breached elsewhere and those cops are essentially outflanked. But there were definitely a lot of displays of some lackadaisical defending we might say, incl fecking posing for selfies that need to be investigated.