So basically, both solutions are technically identical. We know that the set of k is basically {1,2,3,... n-1}. Here, we can clearly observe this solution (considering $z = i cot (\frac{kπ}n)$) has two sets of values. For one of the sets, the value of $\frac{k\pi}n$ lies in the 1st quadrant and for the other half it lies in the 2nd quadrant. For example, $\frac{2\pi}n$ is in 1st quadrant while $\frac{(n-2)\pi}n$ is in the second quadrant. Now the cotangents of these 2 angles are equal in magnitude but opposite in sign. In other words, $$cot (\frac{2π}n) = -cot (\frac{(n-2)π}n)$$
Thus, both sets of values are accounted for by either solution! Hence they are both correct but are basically referring to the same thing.