Does it translate to $$\exists x\forall y((P\rightarrow Q(x))\land ((P\rightarrow Q(y))\rightarrow y=x)),\text{ or}$$ $$\exists x\forall y(P\rightarrow (Q(x)\land (Q(y)\rightarrow y=x)))?$$
$x$ is not free in $P$.
Note: They, I’m pretty sure, are not logically equivalent. But they being not equivalent implies that $\exists !x(P\rightarrow Q(x))$ is not equivalent to $P\rightarrow \exists !xQ(x)$, which is absurd as it is allowed in prenex conversion.
I would say the meaning is the first one.
What about your assertion
What if $P$ is false and $Q(x)$ is "$x = 0$". [Certainly $\exists ! x Q(x)$ is true. But so what?] Then $P \rightarrow S$ is true for any $S$. In particular $P \rightarrow Q(x)$ is true for all $x$, and thus $\exists !x(P\rightarrow Q(x))$ is false because uniqueness fails. On the other hand, as noted, $P \rightarrow S$ is true for any $S$, so in particular $P\rightarrow \exists !xQ(x)$ is true.
So you are correct, they are not equivalent. So I guess your next assertion
is wrong.