I repeated the calculations using 30 and 40 k-points in the Z direction for non-spin polarized system. I have taken exactly the same geometry (it is not the same in the two python scripts you provided), and all the parameters have been kept the same apart from the k-points sampling.
I have attached the input and bandstructure/dos of the two systems. Notice that the dos and bandstructure are calculated with the same precision in both calculations, because this is just a post-scf analysis.
As you can see, the dos and the bandstructure look exactly the same, independently on the k-point sampling used. This strongly suggest that the weird behavior you observed including spin-polarization is due to the fact that the magnetic ground state of the system is quite complex - e.g. anti-ferromagnetic coupling, which is tricky to describe in DFT.
As Petr suggested, you should run the convergence tests without spin polarization. You should especially check two things:
- You should also make sure to lower the threshold for the SCF energy tolerance to e.g. 10-6 Ha or lower.
- You should converge the total energy to 1 meV or lower.
These points are important because for complex magnetic systems, different magnetic solutions may actually differ in energy by just few millielectronvolts.
Good Luck.