I think you forget to subtract double counting. We can divide your 36 ways to get a number by two groups.
1) First group, a pair group contains two '4' together like xx44xxx. We have 6 places and 6 ways to get such kind of a number. Moreover, this group doesn't contain double counting.
2) Second group, a separated group contains two '4' separated by other digit(s) like x4xx4xx. We have 36-6=30 ways to get such kind of a number. But in your reasoning you get the same number twice: x(first placed '4')xx(second placed '4')xx and x(second placed '4')xx(first placed '4')xx represent two ways but only one unique number.
Therefore, we should count numbers as 6+30/2=6+15=21