We have some sound deduction system (every provable sentence is true), which has property of principle of explosion and some theory T described in that system. Lets assume that theory T is inconsistent($P$ and $\neg P$ both belongs to the theory). Because of principle of explosion you can prove some contradictions $Y$ and $\lnot Y$ which both will be true thanks to soundness. That I suppose shows that there is no possibility that you could create inconsistent theory but it is not true because you can always create theory such as $\{P, \neg P\}$ and prove some other contradiction.
What is wrong with this reasoning?
Nono! If the system is sound and you have a theory $T$, then everything (structure, or whatever the context is that you are talking about) that satisfies $T$ will also satisfy everything that the system can deduce from $T$. But if $T$ itself is inconsistent, there is no structure (or whatever your context is) satisfying $T$.
So it is no problem that there is no structure satisfying the things you can deduce from $T$ in your system.
This is like with the truth table of the implication: If the premise $\phi$ is always false, then the implication $\phi\Rightarrow\psi$ is true.