This is a follow-up to this previous question, but under stronger assumptions.
Let $(X, \mu)$ be a (say, $\sigma$-finite) measure space, let $g \in L^2$ (say, over the real scalar field). Let $\tilde g: X \to \mathbb{R}$ be a measurable function and assume that there exists a norm dense vector subspace $D$ of $L^2$ with the following two properties:
The subspace $D$ is an operator range in $L^2$, i.e., there exists a complete norm on $D$ under which the injection $D \hookrightarrow L^2$ is continuous.
For every $f \in D$ the function $\tilde g f$ is integrable, and we have $\int \tilde g f \, d\mu = \int g f \, d\mu$.
Question. Does it follow that $\tilde g = g$ almost everywhere?
Remarks.
Without the assumption that $D$ be an operator range, the answer is no. Two counterexamples were given by Piotr Hajlasz and Gro-Tsen in the answers to question linked at the beginning of the post.
The complete norm on $D$ is not required to render $D$ a Hilbert space (although this might be an interesting variant of the question).
As explained in the previous question, it suffices to show that $\tilde g \in L^2$.
As also explained in the previous question, the answer is yes if $D$ is a lattice ideal in $L^2$ (even if $D$ is not assumed to be an operator range).