Does my attempt look fine or contain gaps? Thank you so much!
Suppose that $X$ is a set of ordinals. Then there exists an ordinal $\beta\notin X$.
My attempt:
Lemma: Let $X$ be a set of ordinals and $\alpha=\bigcup X$. Then $\alpha$ is an ordinal.
I presented a proof here.
Let $\alpha=\bigcup X$. It follows from Lemma that $\alpha$ is an ordinal.
Let $\beta=\alpha\bigcup\{\alpha\}$. It's easy to verify that $\beta$ is an ordinal and that $\alpha\in\beta$.
Finally, we prove that $\beta\notin X$.
Assume the contrary that $\beta\in X$. Then $\alpha\in\beta\in X$ and thus $\alpha\in\bigcup X=\alpha$. This is a contradiction.
Hence $\beta\notin X$.
Your proof is correct like I said in a comment but here is a different way:
We know that $X$ is a set. Assume the contrary, $\forall \beta\in On(\beta\in X)$, then define $f:X\to On,f(a)=a$. It is clear that $f(X)=On$ which implies that the collection of all ordinals is a set. Contradiction