And if there are 7 billion starving people outside the gates of their automated defenses? They will run out of ammunition eventually.
Impossible scenario. First you'd have a pile of dead too high to get over, then you'd have disease, and all of this assuming you could get 7 billion people to surround a compound, which is absurd. Further, the number of poor who would be willing to walk into heavy arms is not going to be large. There's little point trying to get food and shelter by killing yourself. You can say that some will defend the interests of others, and no doubt they would, but also this would be a very small number.
Then there's the "ammunition" thing. Bullets? Really? Will it be a question of bullets? Will a laser run out of photons? How about a tailored disease vector for which the rich have the countermeasure, and the poor don't? Area denial weapons? Chemical weapons? How about armored robots which can simply tear anyone in-the-zone limb from limb?
If the poor become a serious threat (by which I mean, violent), you simply can't argue that they can create and maintain a serious, widespread threat. The first time they go after the unarmed rich, that'll be the end of the unarmed rich, right there. You will almost instantly have armed rich, and now the context is completely different.
See, it's all very well to talk as if the poor were capable of exerting continuous unified force against modern arms, but the idea is utter nonsense: it doesn't stand up under even mild scrutiny.
The only solution to this that has any chance of working is social; government force, used top down, to disenfranchise the rich, and distribute the wealth much more generally than it is now. That's probably what will actually happen, too. If not, it's going to be a hell of a mess, and the poor will almost certainly lose in the process.