Why is it wrong to calculate the amount of oxygen directly from the products of a combustion reaction?
Let's first write the chemical equation for the reaction (I will leave it unbalanced because the stoichiometry is irrelevant):
$$\ce{C_xH_yO_z + O2 -&gt; CO2 + H2O}$$
To do this question, we need to find the mole ratio of carbon, hydrogen and oxygen in $\ce{C_xH_yO_z}$, then we can find its empirical formula. 

From the above equation, it is clear that all the carbon in $\ce{CO2}$ originated from the compound and that all the hydrogen $\ce{H2O}$ originated from the compound. However, all the oxygen in $\ce{CO2}$ and $\ce{H2O}$ didn't just come from the compound, it came from the compound and gaseous oxygen. Therefore, from your method, you are just finding the total amount of oxygen in the reactants, not the number of moles of oxygen in the compound.