The other answers have explained how to solve this problem correctly (using either moles or mass ratios), but not what you did wrong. So let's take a closer look at your reasoning (with my annotation inserted in red):
My understanding was that in normal reaction where there would have
been sufficient amount of reactants, sufficient amount of products
would have been formed according the the ratios of their masses and
the total mass. So I used the below methodology:
Total mass of reactant = Total mass of product = 22g
GMM($SO_2$) = 64
GMM($SO_3$) = 80
Mass of $SO_2$ produced = $\frac{64}{64+80} * 22$
$\quad \color{red}{\leftarrow \text{THE PROBLEM IS HERE}}$
= $0.4444*22$ = $9.7$ ≈ $10$
On the line I've marked with the note above, you've assume that the fraction of the total product mass that will be $\ce{SO2}$ equals the mass of one $\ce{SO2}$ molecule divided by the summed masses of one $\ce{SO2}$ molecule plus one $\ce{SO3}$ molecule.
In other words, you're assuming that exactly 50% of the molecules produced in the reaction will be $\ce{SO2}$, while the other 50% will be $\ce{SO3}$.
Note that the input masses of $\ce{S}$ and $\ce{O}$ don't enter your calculations at all! That's a sure sign that something in your reasoning is wrong, since it means that changing the ratio of the reactants doesn't change the ratio of the products that you've calculated, even though in reality it very much should.
In other words, the answer you got is nonsense. The fact that it happens to match something actually related to the correct answer is just a pure coincidence, no doubt brought about by the strong law of small numbers and the exercise being deliberately designed around simple integer ratios to make it easy to calculate.
In particular, the exercise says that "neither $\ce{O}$ nor $\ce{S}$ will be left at the end of reaction." This means that all the reactants are (assumed to be) consumed in the reaction, and thus that the ratio of the reactants provided definitely must affect the ratio of the products. Specifically, each $\ce{S}$ atom must go into either $\ce{SO2}$ or $\ce{SO3}$ and your task is figuring out the ratio in which these are produced so that each $\ce{O}$ atom also goes into one of these two products.
This is pretty easy to do if you convert everything into moles first, but it can be done using just masses, too. One easy way, as others (such as Maurice) have already noted, is to first assume that all of the sulfur goes into $\ce{SO2}$, consuming as much of the supplied oxygen as it needs to do so.
Let's do that, writing out all the steps and using slightly more accurate molecular masses just for fun:
Molecular mass of sulfur = $M_{\ce{S}}$ ≈ $\ce{32.065 u}$
Molecular mass of oxygen = $M_{\ce{O}}$ ≈ $\ce{15.999 u}$
Mass fraction of sulfur in $\ce{SO2}$ = $x$ = $\dfrac{M_{\ce{S}}}{M_{\ce{S}} + 2M_{\ce{O}}}$ ≈ $\dfrac{\ce{32.065 u}}{\ce{32.065 u} + 2 \cdot \ce{15.999 u}}$ ≈ $0.50052$
Mass of $\ce{SO2}$ produced by reacting $\ce{10 g}$ of sulfur with sufficient oxygen = $m'_{\ce{SO2}}$ = $\ce{10 g} \mathbin/ x$ ≈ $\ce{19.979 g}$
Mass of oxygen consumed in this reaction = $m'_{\ce{O}}$ = $(1 - x) \cdot m'_{\ce{SO2}}$ ≈ $0.49948 \cdot \ce{19.979 g}$ ≈ $\ce{9.9791 g}$
(If you had used $M_{\ce{S}} = \ce{32 u}$ and $M_{\ce{O}} = \ce{16 u}$, this would've of course worked out to $x = \frac12$ exactly, and thus to $m'_{\ce{O}} = \ce{10 g}$, same as the input mass of sulfur. By using more accurate atomic masses we avoided this collision of small numbers.)
Now we just need to figure out how much oxygen is left and how much of the $\ce{SO2}$ needs to be turned into $\ce{SO3}$ in order to consume all of it:
Mass of remaining oxygen after reacting all sulfur into $\ce{SO2}$ = $m''_{\ce{O}}$ = $\ce{12 g} - m'_{\ce{O}}$ ≈ $\ce{2.0209 g}$
Mass fraction of a single oxygen atom in $\ce{SO3}$ = $y$ = $\dfrac{M_{\ce{O}}}{M_{\ce{S}} + 3M_{\ce{O}}}$ ≈ $\dfrac{\ce{15.999 u}}{\ce{32.065 u} + 3 \cdot \ce{15.999 u}}$ ≈ $0.19983$
Final mass of $\ce{SO3}$ produced by reacting all remaining oxygen with $\ce{SO2}$ to form $\ce{SO3}$ = $m_{\ce{SO3}}$ = $m''_{\ce{O}} \mathbin/ y$ ≈ $\ce{10.113 g}$
(Again, with $M_{\ce{S}} = \ce{32 u}$ and $M_{\ce{O}} = \ce{16 u}$ this would've worked out to $m''_{\ce{O}} = \ce{2 g}$ and $y = \frac15$ and thus $m_{\ce{SO3}} = \ce{10 g}$ exactly.)
Mass of $\ce{SO2}$ converted into $\ce{SO3}$ by reacting with the remaining oxygen = $m''_{\ce{SO2}} = (1 - y) \cdot m_{\ce{SO3}}$ ≈ $0.80017 \cdot \ce{10.113 g}$ ≈ $\ce{8.0921 g}$
Final mass of $\ce{SO2}$ remaining after all sulfur and all oxygen has been consumed = $m_{\ce{SO2}}$ = $m'_{\ce{SO2}} - m''_{\ce{SO2}}$ ≈ $\ce{11.887 g}$
Of course we can (and should) also do a final consistency check to make sure that the total mass of the products actually equals the total mass of the reactants: $m_{\ce{SO2}} + m_{\ce{SO3}}$ ≈ $\ce{11.887 g} + \ce{10.113 g}$ ≈ $\ce{22.000 g}$, just as it should be.
Note that, since I performed multiple rounding steps during this calculation, the fact that the total mass happened to round to exactly $\ce{22.000 g}$ is mostly luck. I could've just as easily gotten an answer of $\ce{21.999 g}$ or $\ce{22.001 g}$ or maybe even further off. But as long as the rounding error stays in the last digit, you can be pretty confident that the calculation is right. Or at least not wrong in such a way that it would violate the conservation of mass.
Of course you could also do the calculation with a few more significant digits in the intermediate results and only round to the input precision — which in this case, if we assume the input masses to be exact, is limited by the precision of $M_{\ce{S}}$ and $M_{\ce{O}}$ — at the end.