And Hk series droids understand Rakatan tech why now?
The HK's could simply push the bodies away and move through them with the magnetic boots. Then stand on the ceiling until the shields go down. Or cancel the shields from even coming back online with the console.
Key word being Jedi, Jedi are not Sith, the Hk series have also got a TERRIBLE track record hunting Jedi down, just to make the point.
With the invasion the HK's are programmed to kill Jedi, and the defenses of the factory are programmed to also kill Jedi. The Sith would be slaughtered. the HK's could also use flamethrowers and carbonite attacks to kill the Sith. Or they could be suicide bombers and run with bombs about to go. Droids can be programmed to do anything.
EDIT: with the factory, new droids are constantly being produced. The numbers argument is sort of, not completely, but sort of invalid.
Also, the droid production rate isn't very high, remember in TOR how they stated it's stupidly hard to mass produce Hk-51s? yeh.