Your conclusion about defense being essentially useless is still dead wrong.
Once the first few home invasions, rapings, and pillagings of sleeping residences have occurred. Word will spread. The would be invaders will encounter a round the clock watch setup by a neighborhood or family that invited all their cousins and can afford a 24/7 watch with dogs and even home made alarms.
And those attackers will have the fight of their lives on their hands. Once their surprise element is gone, they lose the initiative to things they can't anticipate without serious new intelligence and all advantage is now reversed and you enter the counter attacking and ambush scenarios which you pointed out is very effective.
That’s not my conclusion, it’s that defense roughly counters the otherwise overwhelming advantage of attackers.
> round the clock watch watch setup by a neighborhood
That’s assuming a great deal of cohesion in your post apocalyptic scenario. I have no problem saying large communities provide a significant defensive benefit, but that’s a product of a working society.
Defensive structures offset but don’t eliminate the advantage of initiative, especially when you start talking about a lone defender who needs to sleep etc.