I agree you did nothing wrong. The power tripping TSA dragon was way out of line, and completely in the wrong. Both in terms of the public shaming and her misunderstanding of etiquette in these situations. With no bags to scan, you're absolutely entitled to go right to the scanner and bypass the x-ray queue entirely. Frankly, by skipping the family, you're helping to alleviate congestion and enabling the process to be more efficient (as the x-ray loading queue is the bottleneck, not the body scanner).
There have been many instances where I'm ready to put my stuff through the x-ray, but a family in front of me is messing around with opening bags, getting liquids, etc, etc, etc. So I just skip ahead while they're getting their lives in order. Why should everyone else wait for folks who aren't ready to go when they get to the front of the queue?