It sounds to me as though they need to mark the entrance to the line-up more clearly. The OP did nothing wrong and the cashier was rude.
This doesn't excuse her attitude, but she had probably been dealing all day with people who got in line in the wrong place, and people from the correct line yelling at her for taking the "wrong" people. Of course, the cashier doesn't usually get to decide how the line-up is marked, so someone should inform management that it is causing confusion.
Reminds me of a time I went into Ubiquitous Canadian Donut Chain. I am not a regular there. I had never been to that particular location. Our group of about seven walked in, and nobody else was in line, so we lined up in what seemed like a logical place (nothing was marked). The cashier said, "Oh, you're lining up over there. Okaaaayyyy........"
After that, people started coming in and lining up in a different spot, so I gathered that they were regulars and that was where the lineup usually began. I was mildly miffed at that cashier for expecting us to know, intuitively, where to stand. It may seem like it sometimes, but not everyone goes to Ubiquitous Donut Chain every day.