Given an orthonormal basis of eigenfunctions $\{ f_n\}_{n=1}^{\infty}$ for a Sturm-Liouville (SL) problem in the interval $[0,L]$, and a function $f(x)$ that does not satisfy the boundary conditions (BC) of the SL problem, in which cases does the fact that $f$ does not satisfy the BC of the SL problem directly imply that the eigenfunction expansion for $f$ does not uniformly converge in $[0,L ]$?
As shown in example 5 (page 7) in these lecture notes that confuse me, the eigenfunction expansion of $f(x)=1$ in the orthonormal basis $\left \{ \sqrt{\frac{2}{L}} \sin(n\pi x /L) \right \}_{n=1}^{\infty}$ does not converge uniformly on $[ 0,L ]$.
In example 6, it is shown that the eigenfunction expansion of $f(x)=x$ in the orthonormal basis $\left \{ \sqrt{\frac{1}{L}} \right \} \cup \left \{ \sqrt{\frac{2}{L}} \cos(n\pi x /L) \right \}_{n=1}^{\infty}$ does converge uniformly on $[ 0,L ]$ (I completely understand how to prove it using Weierstrass M-test and continuity).
In both cases, the function $f$ does not satisfy the corresponding boundary conditions, but in the first case, we deduced that this implies that it is not possible to have uniform convergence in the entire interval, but in the second example we did not. What is the reason for this difference? Is this conclusion only true when the boundary conditions are specified for the function itself but not when they are specified on the derivative of the function?
For your convenience, here are screenshots of the relevant example, (Jim Lambers Mat 606, usm.edu)


Suppose $f\in L^2[0,L]$ is a continuous function on $[0,L]$ with a Fourier sine series $\{ S_n(f) \}_{n=1}^{\infty}$. If $\{ S_n(f)\}$ converges uniformly to $f$ on $[0,L]$, then $f(0)=0$ must be true. So, if $f$ is continuous on $[0,L]$, but $f(0)\ne 0$, then it cannot be true that $\{ S_n(f) \}$ converges uniformly to $0$ at $x=0$.
On the other hand, suppose $f\in L^2[0,L]$ is continuous on $[0,L]$ with a Fourier cosine series $\{ C_n(f) \}_{n=1}^{\infty}$. It is possible for $\{ C_n(f) \}_{n=1}^{\infty}$ to converge uniformly to $f$ on $[0,L]$ regardless of whether or not $f(0)=0$. Such a condition does not conflict with the endpoint condition $f_n'(0)=0$, which is the defining condition at $0$ for the cosine eigenfunction expansion.
Eigenfunction expansions must be viewed in terms of defining endpoint conditions.