I have doubt with Eq. (8.1) in [1] with the item "subst(y,19,number(y))" . The 1st parameter of subst(), i.e. y, is the Godel number of some formula, and the 2nd parameter, i.e. 19, means there is a free variable y in that very said formula. Doesn‘t This operation violate the law of identity?
[1] K. Gödel, “Über formal unentscheidbare Sätze der Principia Mathematica und verwandter Systeme I,” Monatshefte für Mathematik und Physik, vol. 38, no. 1, pp. 173–198, 1931. English Translation "On Formally Undecidable Propositions of Principia Mathematica and Related Systems" by Marin Hirzel, Nov. 27, 2000.

Kurt Gödel's 1931 construction, with respect to a specified formal system $K$, uses predicate $\text B_K (x,y)$ [$\text {proofFor}_K$ in your English translation] that reads "$x$ codes a proof (in formal system $K$) of formula coded by $y$" and then $\text {Bew}(y) = \exists x \text B_K (x,y)$ that reads: "there is a proof (in formal system $K$) of $y$", i.e. "$y$ is provable in $K$".
Using these predicates he defines the relation:
that amounts to saying that "$x$ is not a proof of a certain formula ..." [the author uses $17$ and $19$ respectively to encode the two first variables of the formal language: $z_1, z_2$.]
The expression "$\text {subst} (y, v, n)$" [original: $\text{Subst} \ y(^v_n)$ ] is not a formula in the formal language but an expression in the meta-language describing an operation performed on the syntactical objects of the formal language.
See footnote 20, page 600 of English translation:
How we have to read this operation?
To say that $\text{Subst} \ y(^v_c)$ is equal to $b$ means that for a formula (coded by) $y$, and for a variable coded by $v$ [i.e. by $19$ in the case above] and for a term $c$ [example: $\text {number}(0)$], the result of the "subst" operation will be a formula (coded by) $b$ where the free occurrences of variable $v$ have been replaced with term $c$.
A very simple example can be the formula: $(z_1 = \text {number}(0))$.
If $y$ is the code of the formula [see e.g. here and here for practical exercises in encoding], we have that:
will be the formula: $(\text {number}(0) = \text {number}(0))$.
You have to be careful in understanding the interplay between the formal language of arithmetic, that speaks of numbers, and the metalanguage, that speaks of syntactical objects of the formal language: terms, formulas.
Thus zero and one are numbers whose names in the formal language are $0$ and $s0$ respectively.
According to Gödel's original encoding: $1$ for symbol $0$ and $3$ for symbol $s$, we have that the term (name) in the formal language for number one will be encoded with $2^3 \cdot 3^1=24$.
So, we have three "players" here: the number one, its name in the formal language $s0$, and its "numerical code" [the "Gödel number"] $24$.
In order to master the machinery of the theorem, you have to take care of this interplay between syntactical objects: variables and terms in general, that are used in the formal language to "name" numbers, and numbers used in the metalanguage to name expressions of the formal language.
Regarding the resource How Gödel’s Proof Works that you are referring to, the encoding machinery is slightly different [but see the simple exercise with the encoding of formula $(0=0)$].
Maybe the source of confusion is the statement:
The crux is the point "[the] number y (some unknown variable) ": $y$ is not a variable of the formal language, like $x_1, y_1$ but a variable in the metalanguage, standing for an unspecified number.
Thus, the correct statement must be: