Definition 0. Let $A$ and $B$ denote smooth manifolds. Then a smooth relation $A \rightarrow B$ is a smooth submanifold of $A \times B$.
Definition 1. Given relations $P : A \rightarrow B$ and $Q : B \rightarrow C$, define a relation $Q \circ P : A \rightarrow C$ in the usual way:
$$(a,c) \in Q \circ P \leftrightarrow \exists b \in B((b,c) \in Q \wedge (a,b) \in P)$$
Question. Do there exist smooth relations $P : A \rightarrow B$ and $Q : B \rightarrow C$ such that $Q \circ P$ fails to be smooth?
I suspect the answer is "yes", for the following reason: given submanifolds $P \subseteq A \times B$ and $Q \subseteq B \times C$, my geometric intuition tells me that the submanifolds $P \times C$ and $A \times Q$ don't necessarily intersect transversally. For instance, think of $A=B=C=\mathbb{R}$. Assume $P$ and $Q$ are the unit circle. Then $P \times \mathbb{R}$ and $\mathbb{R} \times Q$ are cylinders at right angles to each other. There should be points where these don't intersect transversally. Maybe that helps.
Your conjectured counterexample works perfectly.
Let $P = \{(a,b): a^2+b^2=1\}$ and $Q=\{(b,c):b^2+c^2=1\}$.
Then $$\begin{align} (a,c)\in Q\circ P &\iff \exists b:a^2+b^2=1 \text{ and } b^2+c^2=1 \\ &\iff \pm\sqrt{1-a^2} = \pm\sqrt{1-c^2} \\ &\iff a^2=c^2 \text{ and } a^2,c^2\le 1. \end{align}$$
Thus $Q\circ P$ looks like an X, which is not a manifold. Consider the top view of this figure:
Paul Bourke, "Intersecting cylinders", 2003