I'm just a 9th grader trying to self-study, so if the question sounds silly to you please excuse me.
$P(x) = x^3 + y^3$ is divided by something like $g(x) = x + 5;$ the degree of the polynomial is $3$. Doesn't the degree of the remainder always be less than that of the divisor. Can someone explain what is happening?
As clarified by the OP in the comments that $y$ is a constant. I would rewrite $y$ as $a$ so that it looks more constant-like for the sake of convenience.
Now $P(x)=x^3+a^3$ and $g(x)=x+5$. By Euclid's Division Lemma for Polynomials you do have $\text{deg}\ r(x)=0$ or $\text{deg }r(x)\lt\text{deg }g(x)$.
You may confirm this by long division method which gives you the following result: $$\dfrac{x^3+a^3}{x+5}=x^2+5x-25+\dfrac{125+a^3}{x+5}$$ or $r(x)=125+a^3$ and $q(x)=x^2+5x-25$ which clearly satisfies $\text{deg }g(x)=1\gt\text{deg }r(x)=0$. So there is no discrepancy.