P vs NP question from GeeksforGeeks
In fact, $Q$ is in NP (since you can reduce it to $S$ in poly-time and $S$ is in NP). It's just not necessarily NP-complete or NP-hard.
For example, let's let $Q$ be the following decision problem:

Given a number $n$, is $n$ prime?

This problem is known to be in $P$. But I can reduce it to something NP-complete, like HamiltonianPath:

First, determine whether $n$ is prime (in poly-time).
If it's prime, let $G$ be a graph with two vertices and one edge between them.
If it's not prime, let $G$ be a graph with two vertices and no edges.
Now, pass $G$ to HamiltonianPath, which will give you your answer.

In this case, $Q$ can be reduced to the NP-complete HamiltonianPath, but it clearly isn't NP-hard or NP-complete (since it can be solved in poly-time).