Is this line of reasoning correct?
If $\big(1+x^2,\:x^3\big) \in \mathbb{Q}[x]$ were a principal ideal, then there would be a polynomial $f\in \mathbb{Q}[x]$ such that $\big(f(x)\big) = \big(1+x^2,x^3\big)$, and so we could conclude that there exist polynomials $a,b,g,h\in \mathbb{Q}[x]$ such that \begin{align} f(x) &= (1+x^2) a(x) + x^3 b(x) \\ 1+x^2 &= f(x)g(x) \\ x^3 &= f(x)h(x) . \end{align} But that would imply that $\mbox{deg}(f)\leq 2$ and hence that $x^3 = (1+x^2) a(x) h(x)$, where $\mbox{deg}(ah) \leq 1$, that is, $a(x) h(x) = A + Bx$ for some $A,B \in \mathbb{Q}$. This, however, contradicts the fact that there exist no rational numbers $A,B$ such that $(1+x^2)(A + Bx) = A+Bx+Ax^2+Bx^3=x^3$. Therefore, $\big(1+x^2,\:x^3\big)$ is not a principal ideal.
The issue in your reasoning is the implication from $\deg(f)\leq 2$ to $x^3=(1+x^2)a(x)h(x)$. You've lost the $x^3b(x)$ term, and what you get is actually that $$x^3=(1+x^2)a(x)h(x)+x^3b(x)h(x),$$ which factors to $$(1+x^2)a(x)h(x)=x^3(1-b(x)h(x)),$$ not a contradiction if $1+x^2$ divides the $1-b(x)h(x)$ factor.
In fact, this ideal (like all ideals in $\mathbb Q[x]$) is principal, and its single generator can be found using a sort of $\gcd$ argument. To get you started, you can find a polynomial in the ideal of degree smaller than $2$, since $$x=x(x^2+1)-x^3\in (1+x^2,x^3).$$