You're right; this is an error in what you've heard. The embedding $i:P\to \hat P$ of a poset $P$ into its complete poset of downsets $\hat P$ is the free completion of the poset, in the sense that every poset morphism
$P\to Q$, where $Q$ is complete, has a unique factorization through $i$ preserving all joins. However, $[-\infty,\infty]$ is not quite the free completion of $\mathbb{Q}$. Indeed, there is no factorization of $i:\mathbb Q\to \widehat{\mathbb Q}$ through the inclusion $\mathbb{Q}\to [-\infty,\infty]$ preserving joins, since the join of the set $\{1-1/n:n\in\mathbb N\}$ in $[-\infty,\infty]$ is $1$, while in $\widehat{\mathbb Q}$ it is $\{x:x<1\}$.
The property that $[-\infty,\infty]$ does have, and more generally that characterizes Dedekind-MacNeille completions $j:P\to \bar P$ of posets, is that $[-\infty,\infty]$ is the universal complete poset admitting a map from $\mathbb{Q}$ which preserves joins which already exist. This is in contrast to $i:\mathbb Q\to \widehat{\mathbb Q}$, which destroys the join mentioned at the end of the last paragraph.
Indeed free cocompletions destroy whatever colimits in a given enriched setting are not absolute-joints of finite sets in posets, splitting of idempotents in ordinary categories, biproducts in categories enriched over abelian groups, etc. So if $Q$ is some complete poset, then maps $\mathbb Q\to Q$ which preserve joins factor uniquely through $[-\infty,\infty]$. We could say that $[-\infty,\infty]$ is the free conservative cocompletion of $\mathbb{Q}$-the cocompletion that doesn't mess up anything we've already handled.
Arguably the Dedekind completion is a bit more abstruse, categorically, than the Cauchy completion. If one views $\mathbb{Q}$ as a category enriched over $[0,\infty]$, that is, as a generalized metric space, then the Cauchy completion is just the closure of $\mathbb{Q}$ in its category of enriched presheaves under absolute colimits-the absolute colimits in metric spaces being essentially limits of Cauchy sequences. For this reason, the closures of other kinds of enriched categories under absolute colimits are sometimes also called Cauchy completions.
We can string together definitions adjunctions, and the occasional use of the Yoneda lemma to get (for any object $C$ in the category $\mathbb{C}$):
\begin{align*}
y(B)^{y(A)}(C)
&\cong \operatorname{Hom}(y(C), y(B)^{y(A)}) \\
&\cong \operatorname{Hom}(y(C) \times y(A), y(B)) \\
&\cong \operatorname{Hom}(y(C \times A), y(B)) \\
&\cong y(B)(C \times A) \\
&= \operatorname{Hom}(C \times A, B) \\
&\cong \operatorname{Hom}(C, B^A) \\
&= y(B^A)(C) \,.
\end{align*}
Best Answer
This is against the philosophy of the Yoneda Lemma.
When we want to prove $X \cong Y$ via the Yoneda Lemma, the whole idea is to look at the whole category and compare how $X$ and $Y$ relate to its objects. Theoretically you could, of course, just consider the full subcategory on $\{X,Y\}$, but this restriction brings extra complexity which would make the proof more complicated. This is because we would focus more on specific objects and their specific properties instead of the whole category.
Also, often the proof works by using universal properties of $X$ and $Y$. Typically, they refer to the whole category. So it is not necessary to restrict it.
Let me show this via an example. If $G$ is a group with two normal subgroups $N \subseteq M$, then $(G/N)/(M/N) \cong G/M$. Here is the Yoneda proof, using the universal properties of quotient groups: If $H$ is a group, we have natural bijections
$$\begin{align*} \hom((G/N)/(M/N),H) & \cong \{\varphi \in \hom(G/N,H) : \varphi|_{M/N} = 1 \} \\ & \cong \{\psi \in \hom(G,H) : \psi|_N = 1, \, \psi|_M=1\} \\ & = \{\psi \in \hom(G,H) : \psi|_M=1\} \\ & \cong \hom(G/M,H). \quad \checkmark\end{align*}$$
As you can see, it is absolutely not necessary to restrict $H$ somehow. And if we did, we would probably start wondering how to use the specific properties of $H$. For example, if we only had $H \in \{G/M, (G/N)/(M/N)\}$, we would start wondering how to construct $\hom((G/N)/(M/N),(G/N)/(M/N)) \cong \hom(G/M,(G/N)/(M/N))$, which is not clear at all. We would probably need to find a map $G/M \to (G/N)/(M/N)$, thus proving the whole thing directly and rendering the whole Yoneda approach useless.
There are many more specific applications of the Yoneda Lemma (some of them compiled in my category theory textbook, by the way). You always find the same pattern: the specific choice of the test object ("probe") does not matter.
Related: Generally speaking categories of "nice" objects (for instance, here the subcategory containing only the two objects we are interested in) tend to be badly behaved.