Probably fairly well
First, keep in mind that Gamp's Law is from Harry Potter and the Deathly Hallows, and thus presents a later stage of Rowling's thinking than Prisoner of Azkaban.
That said, I think the leek spell is entirely consistent with Gamp's Law.
“Your mother can’t produce food out of thin air,” said Hermione. “No
one can. Food is one of the first of five Principal Exceptions to
Gamp’s Law of Elemental Transfigur—"
“Oh, speak English, can’t you?” Ron said, prising a fish bone out from
between his teeth.
“It’s impossible to make good food out of nothing! You can Summon it
if you know where it is, you can transform it, you can increase the
quantity if you’ve already got some—”
—Harry Potter and the Deathly Hallows
Hermione says that it is impossible to produce good food out of nothing. This suggests that is possible to produce something that has the appearance of food, but which provides no nutrition. I suspect the leeks coming out of the students' ears were in that category. Just as, presumably, one cannot eat the birds that Hermione conjured in Half-Blood Prince, regardless of their resemblance to real birds.