Upper-triangular matrix is invertible iff its diagonal is invertible: C*-algebra case
So, the exercise is incorrect as stated, as the nice example in the question shows. They probably meant to say that the matrix is invertible in the subalgebra of upper triangular matrices if and only if the diagonal entries are invertible. This is the version given on page 16 in a set of lecture notes by Matthes and Szymański based primarily on the same book. They also give a counterexample to the original statement.
Hi sorry to resurrect this post. I have a relevant example which I want to remember, and this seems like an appropriate place to put it.
Let $H$ be a separable Hilbert space with orthonormal basis $\{e_0,e_1,e_2,\ldots\}$. Let $S \in B(H)$ be the unilateral shift determined by $S(e_i) = e_{i+1}$ for all $i$. Let $P_0 \in B(H)$ be rank-1 projection onto the span of $e_0$. Then, $U = \begin{pmatrix} S & P_0 \\ 0 & S^* \end{pmatrix}$ is a unitary in $M_2(B(H))$, despite being nondiagonal, upper-triangular, and having both diagonal entries noninvertible.
It's easy to check $U^* U = UU^* = 1$ directly, but the "real" reason this works is that, under the isomorphism $M_2(B(H)) \cong B(H^2)$, $U$ works on the natural basis of $H^2$ by $$ \cdots \mapsto (0,e_2) \mapsto (0,e_1) \mapsto (0,e_0) \mapsto (e_0,0) \mapsto (e_1,0) \mapsto (e_2,0) \mapsto (e_3,0) \mapsto \cdots $$ so $U$ is actually (up to a unitary conjugacy) the bilateral shift.