I have the vectors $A=a\hat e_x$ and $B=a\hat e_y$, so $$ A\times B = \begin{vmatrix} \hat e_x &\hat e_y & \hat e_z \\ a & 0 & 0\\ 0 & a &0 \end{vmatrix}=\hat za^2 $$ Q1: But why is the following wrong \begin{align} A\times B &=a\hat e_x\times a\hat e_y\\ &=(a\hat e_x)\times (a\hat e_y) \tag 1\\ &=(a\hat e_x)\times (\hat e_ya) \tag 2\\ &=a(\hat e_x)\times (\hat e_y)a \tag 3\\ &=a((\hat e_x)\times (\hat e_y)) \tag 4\\ &=a(\hat e_x\times \hat e_y) \tag 5\\ &=a\hat e_z \quad ? \end{align}
Q2: Also, why is this wrong \begin{align} A\times B &= \begin{vmatrix} \hat e_x &\hat e_y & \hat e_z \\ a & 0 & 0\\ 0 & a &0 \end{vmatrix} \\ &= a \begin{vmatrix} \hat e_x &\hat e_y & \hat e_z \\ 1 & 0 & 0\\ \tag 6 0 & 1 &0 \end{vmatrix}\\ &=a\hat z \quad ? \end{align}
What happens here...?
You may be mixing it up with the distributive property of the cross product over addition.
For starters, the determinant notation for computing the cross product is actually just a mnemonic. But if you want to use properties of determinants, you should note that the determinant is linear in its columns and rows, so for example: $$\begin{vmatrix} a & b & c \\ \color{purple}{k}d& \color{purple}{k}e & \color{purple}{k}f \\ g & h & i \end{vmatrix}=\color{purple}{k}\begin{vmatrix} a & b & c \\ d& e & f \\ g & h & i \end{vmatrix}$$ This means that if you want to factor out the $a$, you do that for the second and the third row: $$\begin{vmatrix} \hat e_x &\hat e_y & \hat e_z \\ \color{blue}{a}& 0 & 0\\ 0 & \color{red}{a} &0 \end{vmatrix}=\color{blue}{a}\color{red}{a}\begin{vmatrix} \hat e_x &\hat e_y & \hat e_z \\ 1 & 0 & 0\\ 0 & 1 &0 \end{vmatrix}=a^2\begin{vmatrix} \hat e_x &\hat e_y & \hat e_z \\ 1 & 0 & 0\\ 0 & 1 &0 \end{vmatrix}$$