As an easy way to see that your reasoning is not correct, note that any subset of $\mathbb{R}$ containing exactly one point is compact and connected, but is not homeomorphic to the interval $[0,1]$.
As regards $P,Q$, note that if you remove the $3$ points
$$(0,1),\;\;(0,-1),\;\;(1,\sin(1))$$
from $P$, the remaining set $S$ is still connected.
But if you remove any $3$ distinct points from $[0,1]$, the remaining set is disconnected.
If $f:P\to Q$ was a homeomorphism, the restriction of $f$ to $S$ would be a homeomorphism from $S$ to $f(S)$. But then, since $f(S)$ is equal to $[0,1]$ with $3$ points missing, $f(S)$ is not connected, contradiction.
It follows that $P,Q$ are not homeomorphic.
Here's another way to see it . . .
Since the removal of any of the $3$ points
$$(0,1),\;\;(0,-1),\;\;(1,\sin(1))$$
doesn't disconnect $P$, a homeomorphism $f:P\to Q$ would have to map each of those $3$ points to either $0$ or $1$, but then the pigeonhole principle would imply that $f$ is not injective, contradiction.