Any standard example of elements such that $ba=1$ and $ab\neq 0,1$ is a counterexample for you.
The first says that $a,b$ are both one-sided invertible. Then you can deduce that $(ab)^2=ab$, so $ab$ is a nonzero idempotent. A nontrivial idempotent in a ring with identity (meaning one other than $0,1$) is never left or right invertible because it is both a left and right zero divisor: $(1-ab)ab=ab(1-ab)=0$.
Examples of such rings with $a$ and $b$ like that are scattered throughout the site, but a little hard to search for. I found one here at this related question, although you don't really need to say "bounded linear operators on $\ell^2$," you can just say "linear transformations from $V\to V$ where $V$ is a vector space with countably infinite dimension." For a fixed basis, the "right shift" $a$ and the "left shift" $b$ on the basis elements create linear transformations such that $ba=1$ and $ab\neq 0,1$.