Problem: Is it true that for every $\Pi^0_1$ relation $P(e, t) \subseteq \omega\times\omega$ there is a partial recursive function $g \colon \omega \to \omega$ satisfying $(\exists t)P(e, t) \Rightarrow \left(g(e)\!\downarrow\ \&\ P(e, g(e))\right)?$
My attempt: Take $P(e, t)$ to be $|W_e| < t$. It is $\Pi^0_1$ because its negation is r.e. (just enumerate in a dovetailing fashion all $W_e$ and add a pair $(e, t)$ whenever you see that $|W_{e, s}| \geqslant t$). Then the expression $(\exists t)P(e, t)$ just says that $W_e$ is finite. So $g(e)$ gives an upper bound on the cardinality of $W_e$ whenever it is finite. But such a function can't be recursive. To see this, using recursion theorem define $$W_e = \begin{cases} \{0, 1, \dots, g(e)\},& \text{if } g(e)\!\downarrow,\\ \varnothing,& \text{otherwise.} \end{cases}$$ $W_e$ is always finite, so it must be the case that $g(e)\!\downarrow$ and hence $W_e = \{0, 1, \dots, g(e)\}$, but $|W_e| > g(e)$, a contradiction.
It took me a while to come up with such an example. Initially, I was looking through some "halting problem-like" relations and was trying to show that the existence of such a function $g(e)$ leads to the decidability of the halting problem or something similar, but no one of them worked. Nevertheless, I'm pretty sure that there must be such examples, because the problem is basically "Does uniformization (or $\Sigma^0_1$-selection) principle hold for $\Pi^0_1$ relations?". So it just seems that I was lucky enough and randomly stumbled upon such a counterexample, but don't really have a general understanding of what exact "property" must the relation have to serve as a counterexample.
Question: Is there a more natural (or easier) example of such a relation $P(e, t)$ directly related to the halting problem? Also I'm interested in what specific ideas or knowledge from computability theory have led you to such a counterexample?
Thank you in advance!