Why does decryption in RSA not fail with 2 different moduli? In RSA, we choose $p,q$ and calculate $\phi(n)=(p-1)(q-1)$. We then choose a public key $e$, and calculate its inverse modulo $\phi(n)$: $d\cdot e=1 \mod(\phi(n))$. 

But then, when we decrypt a ciphertext $y=x^e \mod(n)$, we use the different modulus $n$ rather than $\phi(n)$: $x=y^d \mod(n)$. This is equal to $x^{e\cdot d \mod(n)}$, which supposedly equals $x^1$. But I don’t understand this last step, because we chose $d$ such that $e\cdot d=1 \mod (\phi(n))$, not such that $e\cdot d=1 \mod(n)$
The question assumes, wrongly, that $a^b\bmod n$ is the same as $a^{b\bmod n}$ or $a^{b\bmod n}\bmod n$. In general these are three different quantities, as demonstrated with $a=5$, $b=5$, $n=3$:
$$\begin{array}{}
a^b\bmod n&amp;=&amp;\left(5^5\right)\bmod 3&amp;=&amp;3125\bmod 3&amp;=&amp;2\\
a^{b\bmod n}&amp;=&amp;5^{(5\bmod 3)}&amp;=&amp;5^2&amp;=&amp;25\\
a^{b\bmod n}\bmod n&amp;=&amp;\left(5^{(5\bmod 3)}\right)\bmod 3&amp;=&amp;25\bmod3&amp;=&amp;1
\end{array}
$$
Note: going from the second to third expression of the last line uses the result obtained above.