What is wrong with the following reasoning?
If $(X_n)$ is a martingale then $EX_n = EX_0$ for all $n \in \mathbb N$. Therefore if $T$ is a stopping time that's finite a.s., then $T \in \mathbb N$ a.s., thus $EX_T = EX_0$.
Clearly it's incorrect otherwise we wouldn't need the conditions of the optional stopping theorem (e.g. boundedness of $T$).
Let $T$ be a finite stopping time. Consider the martingale $X_{T\wedge n}$. We have that $$ EX_0=EX_{T\wedge n}\tag{1} $$ for all $n$. Since T is a finite stopping time, $T\wedge n=T$ eventually as $n\to \infty$ and $X_{T\wedge n}\to X_T$ a.s. as $n\to \infty$.
We would like to say that letting $n\to \infty $, $EX_0=EX_{T\wedge n}\to EX_T$ but we need some sort of condition on $X_{T\wedge n}$ (e.g. uniform integratiblity) in order to exchange the expectation and the limit.