I think another important aspect of this situation is that it's Costco.
At least based on my own experiences, Costco is the kind of store where "stocking up" is the norm, not the exception. Sure, some people pop in sometimes and buy only one or two items, but that's not really the intent of the way the store is set up KWIM? The contrasting situation would be a place such as a convenience store or gas station, where buying one or two items is the "norm" and buying a whole cartload of stuff would be the exception, though of course both things can be done at both locations.
If the OP had experienced this situation in a connivance store or gas station, I would still not agree that the actions of the employee were appropriate, but I would have some sympathy for the employee and understand her POV a little better, because if the majority of customers are just buying one or two things and they have a reasonable expectation that the transaction will go quickly, and someone is out of the ordinary and has a whole cart of items, then those other customers might be justifiably annoyed.
But at Cosco, it's the other way around. Large carts, even multiple carts are the norm. The few people that come in for one or two things know that they are the ones not following the "norm" and I would hope they would be prepared for the long wait in line that comes with the fact that the usual behavior is to buy lots of stuff.
So, in my mind, the cashier was even more out of line to put the OP on the spot because it was a Costco. If a Costco wants to add an express lane for those one or two item buyers, great, but in the absence of that, customers should just be taken in their own turns (unless the customer with only a few items asks the person in front of them politely and is granted permission, or that person in front of them volunteers) with the full knowledge that lines are slow at Costco.
(Edited because a car is not the same thing as a cart, and a is not the same letter as s)