Consider the quadrature method $$ \int_{-1}^1f(x)dx \approx \sum_{k=0}^N w_kf(x_k), $$ where $x_0=-1, x_N=1$, and $x_1,\ldots,x_{N-1}$ are the roots of the derivative of the degree-$N$ Legendre polynomial $P'_N$. This is called Lobatto quadrature, and it is exact if $f$ is a polynomial of degree less than or equal to $2N-1$. There is a standard proof of of this fact relying on polynomial long division.
My question is about an unusual alleged proof which introduces a basis to avoid long division. I'm told the argument is invalid, but I cannot find fault with it. It uses the facts that the $P_N$ are orthogonal in the unweighted inner product on $C([-1, 1])$, and that $(x^2-1)P'_N(x) \propto xP_N(x)-P_{N-1}(x)$, which are not proved here. Also, $\mathscr{P}_N$ denotes the vector space of polynomials of degree at most $N$. The (potentially flawed) proof follows:
It suffices to show that the quadrature is exact on the elements of any basis for $\mathscr{P}_{2N-1}$. Consider the basis $$ 1,x,\ldots,x^{N-2},P_N'(x),(x-1)P_N'(x),(x^2-1)P_N'(x), x(x^2-1)P_N'(x),\ldots,x^{N-2}(x^2-1)P_N'(x). $$ Since the $x_k$ are distinct, we may choose $w_k$ so that the quadrature is exact for all polynomials with degree $\leq n$, so we need only concern ourselves with those basis terms which are divisible by $(x^2-1)P_N'(x)$. For these, the quadrature rule always gives 0, since each $x_k$ is a root of $(x^2-1)P_N'(x)$. This is correct, as $$ \int_{-1}^1x^m(x^2-1)P_N'(x)dx \propto \int_{-1}^1x^m(xP_N(x)-P_{N-1}(x))dx = \langle x^{m+1}, P_N(x) \rangle - \langle x^{m}, P_{N-1}(x) \rangle. $$ By properties of the Legendre polynomials, the inner products vanish when $m\leq N-2$, so the true integral equals zero, the same as the quadrature rule! Linearity allows us to say that the rule is exact for all polynomials of degree $\leq 2N-1$, since it is exact for a basis.
Try as I might, I do not see the mistake above. If there is an error, I'd accept an answer which points it out.