Proving 1 = 2 by POAC( Principle of Atom Conservation )
As said by many others ,  The equation 1 given above is simply put very wrong  . As it can be applied only when a balanced chemical equation is given to us ,  otherwise we will reach at all sorts of contradictions as in the question above .

However many non- rigorous teachers , textbooks often write equation 1 in POAC (which is always true in a balanced chemical equation ) and then say now equation 2 is obtained from equation 1(which is partially incorrect) . It is true equation 2 comes naturally from equation 1 , but only for a balanced chemical equation. 

So then how come we apply equation 2 in POAC in all sorts of question ? And still come up with the right answer ?

The answer is that equation 2 is true in itself always whether the chemical equation given ( in POAC ) is balanced or not . So it is not related to equation  1 for its validity . 

How is equation 2 always valid ?

As pointed out by @iammax in the comments actually we (sort of )  essentially balanced the chemical equation given to us in the equation 2 itself . 

For example in the $KClO_3$ question linked above , the moles of $O_2$ , moles of $KClO_3$ given to us are actually according to the stoichiometric coefficients , which enable us to use POAC without balancing the reaction (even though we have done that indirectly by using No. of moles of $O_2$ , $KClO_3$). 



To conclude we can say after using No. Of moles of reactant , product we have indirectly balanced the chemical equation as the Ratio of their number of moles will be 
Equal  to Ratio of their respective stoichiometric coefficients . After which we just use Conservation of Atoms( as the name says it) and multiply the number of moles of the molecule with the number of Atoms present  on which POAC is being applied ( For example we multiply no. Of moles of $O_2$ by 2 when we apply POAC on oxygen atom ).