How many unused inputs are there in a BCD adder?
Like you commented, you have to multiply with 10 instead of 9.
There is however another point incorrect.

You need to add the invalid ones times the invalid ones once, so

$$[(6*\color{red}{10})*2+(6*6)*\color{red}{1}]*2 = 312$$

To link your approach with Jonk's approach:
Defining variable a the number of valid BCD codes (a=10), b the number of invalid BCD codes (b=6) and a+b (therefore) the total number of codes,  

Jonk's approach is
$$ 2*((a+b)^2-a^2) $$
Rewriting 
$$ 2*((a+b)^2-a^2) = $$
$$ 2*(a^2+2ab+b^2-a^2) = $$
$$2*( 2ab + b^2 ) $$ 
which is your approach.