Let $s=x+y$ and $T_n$ be the $n$th triangular number $n(n+1)/2,$ including $T_0=0$ for later. If you restrict $x,y$ to be positive integers, then your formula gives $T_s+x$, where from $x+y=s$ it would follow that $1 \le x \le s-1.$ The first triangular number usable with positive $x,y$ is $T_2=3$. So the formula would miss the integers $1,2,3,$ then cover $4$ but skip $5.$ The next triangular number is $T_3=6$ which your formula would skip and next it would cover $7,8$ on using $x=1,2$ and skip $9$.
But the formula you have works fine provided we change "natural number" to include $0$. This means we allow the variables $n,x,y$ to range over nonnegative integers (rather than positive only). The first few trianglular numbers are $T_0,T_1,T_2...$ listed as
$$0,\ 1,\ 3,\ 6,\ 10,\ 15, \cdots.$$
Then the formula $T_s+x$ is applied with $0 \le x \le s.$ This fills in the above list completely, and every (nonnegative) natural number gets a unique position. Note that going one step beyond the upper bound $s$ for $x$ would give $T_s+s+1$ which is the same as the next triangular number $T_{s+1}.$ But in the enumeration $0 \le x \le s$ follows from the definition of $s$ as $x+y.$
To go backward from $n$ to the pair $x,y$ we can first find $s$ so that $T_s \le n <T_{s+1}.$ This gives us the value of $x+y$, and then we have $x=n-T_s,$, and so finally have found $x,y$ for the given $n$.