Assume I have a càdlàg Markov Process $(X_s)_{s \geq 0}$ with generator $\mathcal{L}$ and an open set $O$. Set $T = \inf (t > 0, X_t \in \bar{O})$ and $\mathbb{E}_x[f(X_s)] = \mathbb{E}[f(X_s)|X_0 = x]$ for any integrable function $f$.
I think that $\mathcal{L}(V(x)) = - 1$ when $V(x) = \mathbb{E}_x[T]$ and $x \not \in O$, mainly because it is true when working with Markov chains (but not easy to adapt to the continuous setting), or with diffusions using the Dirichlet problem and I don't see where that would fail. I have only seen proof of upper bounds on $LV(x)$ for more complicated functions, but I was wondering how to make the computation myself.
What I think would be enough to obtain a proof is a computation showing that $V$ is in the domain of $\mathcal{L}$, but I have no idea of how to derive it without using the result I'm looking for.
As pointed out by mbartczak, $V$ may be infinite for some $x$ without further assumption, by I will always assume that I know that this quantity is finite for all $x$.