Suppose that $X$ is a scheme, say smooth, connected of finite type over a field of characteristic zero, $Y \to X$ is a smooth morphism of relative dimension $d$, and $f_1, \dots, f_d \in \mathcal{O}(Y)$ are $d$ global sections. Let $Z = Z(f_1, \dots, f_d) \subset Y$ be the closed (not necessarily reduced) subscheme defined by the global sections. Assume that the composite $Z \to X$ is finite.
What can be concluded in this situation? As far as I understand if $Z$ happened to be integral then it would be Cohen-Macaylay and flat over $X$. Is there something that can be said in greater generality? What if I assume that $X$ is the spectrum of a Henselian local ring, for example?
Related question: Are finite correspondances flat?