OP , you are confusing me!
Firstly, you said you were upset about the detention. I absolutely agree , as do many PPs that children should not ever be punished for doing badly in a test, assuming they behaved .
However, really what you have revealed is that you think your child should not be given a second chance and have gone off on some mantra about skewed data.
Your rudeness to the lovely Trifle suggests you are not a teacher, but your obsession with the reliability od fata actually makes you sound like you should a school leader!
Life gives us lots of second chances. Resitting something or improving something is called learning from mistakes. it's one of the reason why schools are obsessed with feedback and green pens these days.
Your child is in Y8. Why should he learn so early in life that no one can - or should - improve?
I believe it was Robert The Bruce who said ' if at first you don't succeed' You seem to be teaching your child to put up with mediocrity. The driving test example is a good analogy.
I don't agree with the detention. Although the teacher punishes herself just as much there!
But reattempting the test comes from solid pedagogical theory.