The problem is that
$$ (397)_{10} = 3 \cdot 10^2 + 9 \cdot 10^1 + 7 \cdot 10^0 \ne 3 \cdot 9^2 + 9 \cdot 9^1 + 7 \cdot 9^0 = (397)_9. $$
What we are trying to do is solve
$$ (397)_{10} = 3 \cdot 10^2 + 9 \cdot 10^1 + 7 \cdot 10^0 = a \cdot 9^2 + b \cdot 9^1 + c \cdot 9^0 = (abc)_9 $$
To find $a$ we take as many copies of $81$ from $397$ as we can:
$$ 397 - 4 \cdot 81 = 73. $$
Thus $a = 4$. Next, we take as many copies of $9$ from $73$ as we can:
$$ 73 - 8 \cdot 9 = 1, $$
so $b = 1$. Lastly, we take as many copies of $1$ from $1$ as we can:
$$ 1 - 1 \cdot 1 = 0. $$
Hence $c = 1$. Therefore the answer is $$(397)_{10} = (481)_9.$$