The latin root of the word
flock which is also the root of many other English words that deal with groups or "flocks" (usually of people): aggregate, congregate, segregate, gregarious...
But I don't see how the definition of egregious has anything to do with a flock or group.
egregious [ih-gree-juh s] adjective
- extraordinary in some bad way; glaring; flagrant: an egregious mistake; an egregious liar.
- Archaic. distinguished or eminent.