You're giving the etymology for "gogna", the Italian word for the device. We're talking about the etymology of "pillory", which is an English language word. Just because it's the same device, it doesn't follow that the Italian and English names for the device have the same etymology. Two different words, in two different languages, are going to have two different etymologies.
Here's the English language page for "pillory" -
You must be registered to see the links
. You'll find the same etymology which I have already given.
As for pillories being in use even before the medieval period, I'll need a source for that, as well. The medieval period, or middle ages, is typically held to be the time from about AD 400 to about AD 1499. The earliest documented reference to a pillory, at least so far as I can discover, is in the Utrecht Psalter, a document which is arguably dated to either the 400s or the 800s. Older scholars tended to date the document to sometime in the 400s, while current scholars tend to favor a date in the 800s. I see that the Utrecht Psalter is mentioned on the Italian Wikipedia entry for gogna, so I'm guessing that you are already aware of this document. Since either of these dates would place the document within the medieval period, I'm not aware of any verifiable historical references to pillories being used before the medieval period began. Is it possible? Sure. Do we have any historical documentation of it? Not to my knowledge.