Just because the US anticipated a shock and awe type campaign doesn't mean that it wouldn't work.
And for reasons stated elsewhere ad nauseam, Ukraine is not the place to run an insurgency. Afghanistan is a very different time and place.
TL:DR Russia drastically miscalculated on several occasions.