Change of basis in Dirac Notation

Question: An operator $A$ is in a particular basis $|a_i\rangle$ (where $i=1,2$), and is represented by $$A=\begin{pmatrix} 0 & -i \\ i &0 \end{pmatrix}$$ Now, define two new basis vectors $|b_i\rangle$ by $$\langle a_i | b_1\rangle =\frac{1}{\sqrt{2}}\begin{pmatrix} 1 \\ 1 \end{pmatrix}$$ $$\langle a_i | b_2\rangle =-\frac{i}{\sqrt{2}}\begin{pmatrix} 1 \\ -1 \end{pmatrix}$$

What is $A$ in the new basis?

Attempt: First, I defined the transformation matrix $U$: $$U=\begin{pmatrix} \langle a_1 |b_1 \rangle & \langle a_1 |b_2 \rangle \\ \langle a_2 |b_1 \rangle & \langle a_2 |b_2 \rangle \end{pmatrix}=\frac{1}{\sqrt{2}}\begin{pmatrix} 1 & -i \\ 1 & i \end{pmatrix}$$

If we let $A'$ be the matrix in the new basis, we obtain $$A'=UAU^\dagger$$ And it is a simple calculation (by hand or through mathematica) to show that $$A'=\begin{pmatrix} 1& 0 \\ 0 & -1 \end{pmatrix}$$ However, I wanted to check my work using Dirac notation, so I used the equation $$A_{ij}'=\langle b_i |A|b_j\rangle=\sum_{n,m} \langle b_i |a_n\rangle A_{nm} \langle a_m | b_j \rangle$$

A sample calculation of $A_{12}'$ is shown below: $$A_{12}'=\sum_{nm}\langle b_1 | a_n \rangle A_{nm} \langle a_m | b_2 \rangle$$ $$=\langle b_1|a_1\rangle A_{12}\langle a_2 | b_2 \rangle+ \langle b_1 |a_2\rangle A_{21}\langle a_1|b_2\rangle$$ $$=\frac{1}{2}(1)(-i)(i)+\frac{1}{2}(1)(i)(-i)=1$$ Using the same method for the other components, we find $A'$ to be $$A'=\begin{pmatrix} 0 & 1 \\ 1 & 0\end{pmatrix}$$ My question is which method is incorrect? Do I have the formula for the matrix U wrong, or am I not using Dirac notation right? Thank you in advance.

Your solution using Dirac Notation is correct. The mistake in your first attempt is: If you define the Transformation by this $U$, then
$$A'=U^\dagger A U = \begin{pmatrix} 0 & 1 \\ 1 & 0\end{pmatrix} \neq U A U^\dagger$$.
You can easily check this: For example if you apply $A$ to $b_1$ in basis of $a$ you get $b_2$ and vice versa (exactly as $A'$ tells you).