Suppose we have a changing magnetic field parallel with the $z$ axis that follows the equation
$$\vec{B} = \frac{B_0}{z} \hat{u_z}$$
If we were to choose a spherical closed surface $\Sigma$ with radius $r$ and centered at a distance $d>>r$ from the origin of the $z$ axis, Gauss's law for magnetism states that the net magnetic flux through that closed surface equals zero.
$$\Phi(\vec{B}) = \oint_{\Sigma}^{}\vec{B} \cdot dA\hat{u_z} = 0$$
However, when we calculate the flux, $z$ is smaller on the lower half on the sphere since it is closer to the origin than the other half and thus $\vec{B}$ is stronger on the closer half and weaker on the other. Wouldn't those contribution add up to a nonzero magnetic flux, even though the same number of field lines both enter and exit the spherical surface? Is this a violation of Gauss' theorem for magnetic fields?
Image for reference: