Sort of. I believe the one where Elayne and Nynaeve both were in danger of revealing Egwene's deceit in respect of the Wise Ones was a different time, where Egwene more of less rode roughshod over them in the conversation subsequently, and left them.
This instance, which did include the nightmare, was where Nynaeve was asking questions when only Egwene was there, but were potentially going to open the same can of worms as above. Egwene took the opportunity to try and show Nynaeve just how dangerous the world of dreams was, as Nynaeve at that stage was quite cavalier (and continued to be so really until her last confrontation with Moghedian).
The tea came about as Nynaeve was trying to skirt around a lie she told, and Egwene then used a treatment that Nynaeve used to use on people when they were lying, to force Nynaeve to tell the truth.
She did not "force" Nynaeve to tell the truth, Nynaeve volunteered the truth, and Egwene threatened to force her to drink the tea out of spite because Nynaeve had made her drink it when she had legitimate authority over Egwene. And it was not a direct lie to Egwene, the way Egwene acted as if it had been, but rather a face-saving thing with the Wise Ones. A few hundred miles short of the extent of lying to the Wise Ones about being an Aes Sedai and breaking your word not to go into T'A'R without them. Note that Nynaeve, faced with the same dilema of necessity versus the Wise Ones' demands, refused to give a promise she had no intention of keeping.
The incident was from the PoV of the highly-scrupulous Nynaeve, who was feeling guilt at having acted a tiny bit like Egwene, so Egwene's acts are not shown in an objective light, and she comes across as more righteous than she was, seen through the lens of Nynaeve's guilt.
Following that, there are many points in the following two books at least where Nynaeve goes to lie, or at least skirt the truth, but then has the taste of tea in her mouth and subsequently tells the truth instead.
Rather than Egwene teaching her a lesson, it was more that she was remembering the consequences of surrendering the moral high ground through dishonesty. That's a lesson no one "needs" to teach Egwene, because rather than scrupulously make amends as soon as she realizes her fault, she waits until she has no further use for the people she has lied to, and handwaves the lies away as long as it is convenient to do so.
I just feel it isn't entirely fair to judge Egwene too harshly on this, when if she went through what the others went through, or had people forcing behaviour like she did for others, she may have changed her ways too.
So she was spoiled, not trained in moral behavior, and this is a person who should be grabbing for power with both hands at every opportunity? The reasons and origins of Egwene's misbehavior are plausible and solid. It does not change the fact of her misbehavior and the current reality of her character, which are deplorable.