In the earlier question we consider a random variable $P$ uniformly distributed on $[0,1]$ and a sequence $X_1,X_2,X_3,\ldots$ that were conditionally independent given $P$, and conditional on $P$ each $X_i$ is equal to $1$ with probability $P$ and $0$ otherwise. Then we considered the random variable $K=\min\{k\in\{1,2,3,\ldots\} : X_1+\cdots+X_k=n\}$. The probability distribution of $K$ was found to be given by $\Pr(K=k)=n/(k(k+1))$ for $k=n,n+1,n+2,\ldots.$ Finally, it was found that $\mathbb E(K)=\infty$.
The question was posed in comments, whether $\mathbb E(K)$ would be finite if $P$ had been distributed uniformly on $[\varepsilon,1]$ for some $\varepsilon>0$.
I will answer that here. That doesn't fully answer the question as posed above, but perhaps that is what is of interest.
So suppose $P$ is distributed uniformly on $[\varepsilon,1]$ and $0<\varepsilon\le 1$. Then
$$
\mathbb E(K) = \mathbb E(\mathbb E(K\mid P)) \overset{(1)}{\le} \mathbb E(K\mid P=\varepsilon) \overset{(2)} = \frac n \varepsilon.
$$
The equality $(2)$ is well known. I will leave the proofs of $(1)$ and $(2)$ as an exercise for now. Maybe more later$\ldots\ldots$.