What you're neglecting there is the dependence between variables.
Since the question specifies nothing about dependence, if we knew we had a beta prime and that it was a ratio of two random variables, we don't have any good reason to anticipate that they were gammas in the numerator and denominator. It might be the case (you can certainly construct a case where it's true) but might not be the case for the variables at hand.
If we also knew for certain that the numerator and denominator were independent it might be possible to construct a proof that they were gamma; it might, for example, be possible to do something with characteristic functions of their logs - but it's not immediately obvious this would necessarily be the case; (I wouldn't be surprised if it were the case but I don't have a demonstration of it).
Not quite what was asked, but related to a common kind of question I get asked: If you take a beta prime and multiply it by an independent gamma, you shouldn't expect to get a gamma back out. That would correspond to saying that $X_1 X_3/X_2$ (for all three being independent gammas) is itself gamma, which isn't the case -- for example typically it is considerably more heavy-tailed than a gamma.