Godel's argument is conditional on the consistency (or more, depending on what argument/version of the Godel sentence you're using) of the system in question. For example, first-order Peano arithmetic ($\mathsf{PA}$) can prove "If $\mathsf{PA}$ is consistent then $X_\mathsf{PA}$" where $X_\mathsf{PA}$ is the Godel-Rosser sentence for $\mathsf{PA}$. However, $\mathsf{PA}$ cannot prove $X_\mathsf{PA}$ outright (unless $\mathsf{PA}$ is inconsistent in the first place of course).
You always need to be careful about what is being proved where. Keeping the specific system implicit creates the impression of a circle where there isn't one: the right way to pose Godel's theorem in a general setting is
there is no computably axiomatizable consistent complete theory interpreting Robinson arithmetic
which is outright provable in, say, $\mathsf{PA}$ (the phrase "interpreting Robinson arithmetic" is rather technical, but basically it's a precise way of saying "sufficiently strong" and - to the best of my understanding - is fairly close to optimal). But this doesn't yield a $\mathsf{PA}$-proof of $X_\mathsf{PA}$ (or anything similar), since $\mathsf{PA}$ doesn't know that $\mathsf{PA}$ is consistent (we hope!).
Separately, your attempt to symbolize the incompleteness theorem has a serious issue: we don't need the sentence $X$ to literally have the same Godel number as "$X$ is not provable (in the system in question)," we just want $X$ to be provably (in the system in question) equivalent to its unprovability (in the system in question). This is a much more flexible criterion; see e.g. the discussion here.