Change of basis matrix between orthonormal bases of different inner products We were recently given the following exercise:

Given a vector space of real polynomials of degree 2 defined over the interval [-1,1], let the inner product be defined as $\langle f,g\rangle = \int_{-1}^1 f(t)g(t)dt$. Let the following be an orthonormal basis in terms of this inner product: $\{\frac{1}{\sqrt{2}},\sqrt{\frac{3}{2}}t,\frac{3}{2}\sqrt{\frac{5}{2}}(-\frac{1}{3}+t^2)\}$.

We were also given two polynomials (which are irrelevant to the problem I'm having) and then had to use Parseval's identity to find the "angle" between these two polynomials. Parseval's identity states that the abstract inner product between the two polynomials is the same as the euclidian inner product between their coordinate vectors in terms of this orthonormal basis.
So as a first step, I tried to find a change of basis matrix from the given orthonormal basis to the "standard" basis for polynomials, where $\begin{pmatrix}1\\0\\0\end{pmatrix}$ represents a constant polynomial, $\begin{pmatrix}0\\1\\0\end{pmatrix}$ represents $t$ and $\begin{pmatrix}0\\0\\1\end{pmatrix}$ represents $t^2$.
The coordinate vectors of the orthonormal basis in terms of the standard basis are thus $\begin{pmatrix}\frac{1}{\sqrt{2}}\\0\\0\end{pmatrix}, \begin{pmatrix}0\\\sqrt{\frac{3}{2}}\\0\end{pmatrix}, \begin{pmatrix}-\sqrt{\frac{5}{8}}\\0\\ \sqrt{\frac{45}{8}}\end{pmatrix}$.
Now, this is were I'm confused. The change of basis matrix, which takes coordinate vectors from the orthonormal basis to the standard basis, is $\begin{pmatrix} \frac{1}{\sqrt{2}} &&0&&-\sqrt{\frac{5}{8}} \\ 0&&\sqrt{\frac{3}{2}}&&0 \\ 0&&0&&\sqrt{\frac{45}{8}}\end{pmatrix}$.
This matrix is clearly not orthogonal. However, a few days ago we learned that the change of basis matrix between two orthonormal bases must always be orthogonal, and both bases I gave are clearly orthonormal. What am I missing here? Does it make a difference that one basis is orthonormal in terms of the euclidian dot product and one basis is orthonormal in terms of the newly defined inner product?

The result you mentioned is about a change of basis in the same $(E, \left <\,,\right>)$ inner product space. When you change the inner product $\left <\,,\right>$, distances and angles change too. To see this, take $E=\Bbb R^2$, $\left <a,b\right>=a_1b_1 +a_2b_2$ and $a=(-1,-1), b=(1,-1)$. We have $\left<a,b\right>=0$. Now, if $\left <a,b\right>=2a_1 b_1 + 3a_2b_2$ (you can check that is is an inner product on $\Bbb R^2$), we have $\left <a,b\right>=-2+3=1 \neq 0$.
