The script is working fine but its if (nr[$1] != i) test in the END clause is more than dubious.
You are explicitly excluding the line(s) which second field is equal to the second field of the last line read, here 10 6
It uses nr[$1] , which is $NF of the last line. What are you trying to achieve?
--
As an aside: $1 happens to be available because your particular awk retains that value in the END section. With some awks this value will be "", since the field variable are only available in the middle section.