The following question was asked at https://mathoverflow.net/questions/361367/uniform-integrability-contradicts-convergence-to-l2-subspace :

Let $V$ be a finite-dimensional subspace of $L^2(\mathbb{R})$.

Assume that $f_n$ is a sequence of square-integrable functions with $\Vert f_n \Vert_{L^2}=1$ that satisfies two properties:

1.) $d(f_n,V) \rightarrow 0$ that is the distance to $V$ vanishes in the limit

2.) There exists a uniform (in $n$) constant $k$ and a strictly positive function $g$ such that the following uniform integrability condition holds $$\int_{\mathbb{R}} g(x) \vert f_n(x) \vert^2 \ dx \le k.$$

I want to show that if for all $v \neq 0$ in $V$ we have

$$\int_{\mathbb{R}} g(x) \vert v(x) \vert^2 \ dx=\infty$$ then such a sequence $f_n$ cannot exist.

The intuition is that the $f_n$ are more and more supported in $V$ where every element has infinite integral against $g$, so the uniform integrability condition cannot hold.

EDIT: If we knew for example that $f_n$ would not just converge to $V$ but to a fixed element $f$ in $V$, then it would follow that for a subsequence of the $f_n$ we would have $f_n \rightarrow f$ almost everywhere and thus get a fast contradiction using Fatou's lemma.

The question was then deleted by the OP while I was typing the answer. I thought the question might still be of some interest and will give an answer to it below.