A possible "finite set avoiding" version of Grothendieck's Zariski Main Theorem? Recall that in EGA $IV_3$ (Théorème (8.12.6)), Grothendieck calls the following theorem ``Zariski's Main Theorem":

Let $Y$ be a quasi-compact separated scheme, and $f : X \to Y$ is a
separated quasi-finite finitely presented morphism. Then it factors
into $X \to Z \to Y$, where the first is an open immersion and the
second is finite.

The way I always remembered this was as a quasi-finite version of a compactification theorem (e.g. Negata), so let's call $Z \to Y$, a compactification of $X \to Y$.
Regarding it, here is my question:

Under the situation of the above ZMT, in addition suppose both $X$, $Y$ are  smooth integral affine $k$-schemes of finite type over a field $k$, with a sufficiently high dimension $>0$. Suppose we have a given finite set $S \subset Y$ of points. Then can
we find a compactification $Z \to Y$ such that the image of the ``bad
set" $B:= Z \setminus X$ in $Y$ under the finite morphism does not intersect the given finite set $S$?

Maybe I am making some redundant assumptions here. Note that since $Z \to Y$ is finite, the image of the bad set is a proper closed subset of $Y$. So, if the above holds, then I can actually find an affine open neighborhood $U$ of $S$, over which $X_U \to U$ itself is finite from the beginning.
I hope someone may know an answer, or may have an idea that may become useful in its resolution.
 A: There is in fact a 'preferred' choice of Zariski factorisation:
Definition. Let $f \colon X \to Y$ be a quasi-finite morphism of varieties over a field $k$. Then let $Z$ be the normalisation of $Y$ in $X$, i.e. $Z = \operatorname{\underline{Spec}}_Y \mathscr A$ with $\mathscr A$ the normalisation of $\mathcal O_Y$ in $f_* \mathcal O_X$.
Note that $g \colon Z \to Y$ is finite [Tag 0BXS], and the map $\iota \colon X \to Z$ is an open immersion [Tag 02LR].
Lemma. Let $U \subseteq Y$ be an open above which $f$ is finite. Then $\iota$ is an isomorphism above $U$.
Proof. This is immediate from [Tags 035K and 03GP]. $\square$
If $f$ is finite above $\operatorname{Spec} \mathcal O_{Y,y}$ for some $y \in Y$, then it is finite in a neighbourhood of $y$. Thus, there exists a (nonempty) maximal open $U \subseteq Y$ above which $f$ is finite, and above this set the open immersion $\iota \colon X \to Z$ is an isomorphism. We conclude that
$$g(Z \setminus X) = Y \setminus U,$$
so $g(Z \setminus X)$ avoids a set $S$ if and only if $S \subseteq U$, i.e. if and only if $f$ is already finite above $S$.
