The problem here seems to be that you seem to be taking $\lVert x \rVert$ to mean the canonical norm on $\mathbb R^n$, whereas your book uses it to mean the norm defined by $q$. This has nothing to do with the basis $B$; you can just take out the sum of the squares of the coefficients $x_i$ and are left with the equation $q(x)=\lVert x \rVert^2$. The basis $B$ doesn't occur here, and the equation clearly shows that $\lVert x \rVert$ is to be interpreted as the norm defined by $q$ and not the canonical norm. The notion of orthonormality, too, is relative to the norm/quadratic form, so, as wildildildlife has shown, $B$ is indeed orthonormal, but orthonormal with respect to $q$, not in the canonical sense.