That was indeed the great Union fear throughout the spring and summer of 1861, and beyond.
After defeat in the First Battle of Bull Run/Manassas (July 1861) Washington lay open to a decisive Confederate thrust, which however never came.
Fear was especially heightened, you may remember, under Union General McClellan, whose Pinkerton security people kept exaggerating Confederate troop strength by almost orders of magnitude -- 1,000 became 10,000 and 10,000 got reported as 50,000, etc.
So Washington, DC was in near panic for many months until Union troop strength there eventually reached levels even exaggerated Confederate armies could not defeat.
At the same time, Confederate generals of the caliber of Lee or Jackson were few & far between and Davis, considering himself the ultimate military genius, overrode generals' advice on occasion.
Results, iirc, were that assaulting Washington itself was not seriously considered.
Of course, Lee's invasions of Maryland in 1862 and Pennsylvania in 1863 had threatening Washington as their ultimate targets, in hopes of negotiating peace on Confederate terms.
Jubal Early's July 1864 assault on Washington to us seems quixotic, but is best understood as RE Lee's effort to relieve pressure from Grant on Richmond.
And it worked.
Early remarked after the battle: "...we didn't take Washington but we scared Abe Lincoln like hell."
By summer of 1864 that was about the best Confederates could hope for.