If you know for sure you made a mistake AND you know for sure which shot on the target was the mistake then I suppose it would make sense to discount that shot and shoot another one to make up for it. Except of course if the goal is to evaluate the worst case performance, in which case the mistake probably shouldn't be eliminated since it certainly contributed to a worst case performance.
If a shooter includes known fliers in their group measurement, then it's no longer an accuracy test, it's now an IQ test, and the shooter just failed.
If one is trying to evaluate their worst case performance, they should shoot blindfolded. That would fit the description.
I'm not really in favor of trying to pick and choose which shots to keep and which ones to leave out when shooting groups because....
There's also the situation where you know you made a mistake but you're not sure which shot on target it is. Maybe the "flier" that is high and right is the mistake you know you made, or maybe it's telling you about an ammo problem or a gun problem, and the actual mistake wasn't actually as bad as you thought it was. Once you start trying to pick and choose shots or groups, then you're never really sure if the numbers are telling you about how the shooting is going or if they're telling you how good you are at throwing away shots or groups to make the results come out the way you want them to.A simple and effective way to know if you have enough is to stop when the average isn't changing significantly any more. If all the groups are fairly consistent then it will stabilize very rapidly.
Only known, called fliers can legitimately be removed from group measurements. Guessing which one(s) might be the flier(s) is called cheating, and also fits the description of failing an IQ test.
There is variability even with multiple groups shot from a Ransom Rest, so stability in group size is a bit of a myth. In this article (https://americanhandgunner.com/exclusive-consistent-velocity-accuracy/) the author found up to a nearly three-fold difference in group size when shooting 15-shot groups (many more rounds than mere 5-shot groups) from a Ransom Rest.
Or, you could just pick a number of groups you want to shoot and pick the number of shots per group that seems reasonable to you and go for it. Five shot groups are pretty common for handgun accuracy evaluation and averaging a handful of those should provide decent results. You'll see that approach commonly used in published reviews.
Yes, multiple the 5-shot groups are traditional. But that does not mean there isn't a better way.