What went so absurdly wrong that the Gnolls got close enough to deal damage in melee?

In the first encounter on the road with the hyenas, kill the hyenas from range, walk around the hill and circle back toward them from the higher elevation, keep going past them to the ledge that hooks back around. Two rounds, max, you should be able to take them out with long bows and short bows. They should never even get close enough to see you. Sneak attack helps here, but other that that, I used arrows and cantrips (I refuse to let my party sleep since Lez wants the cure first). If you are talking about the second, sneak up to the top of the overlook near the cavern entrance. Kill the unit closest to you with stealth (Rapier, 16 dex, it was a one hit kill and should always be an automatic crit) which launches a surprise round in which you should be able to pick off the caster and one or two of the damaged archers. The Flind and the hyenas shouldn't do anything for two more rounds. By that time, only the Flind should be left. If the Flind is left at all.
.

This is all just free xp