The proposed solution misses the fact that you can't even derive that the liar has a hat because the subject of the predicate could be the lie. What if the liar had two green cars but any number or no hats? The lie is a lie then even if the statement is vacuous as there is too much ambiguity in the english language overall. Their hats could be any combination of colors or they could even be hatless if the lie was over the subject of the constraint, not the qualification of the subjects, as they were effectively miscommunicating what is green.
Even if that is the case -- if he has no hats, then the statement is technically true, and regardless of whether he intended to lie or not, he made a true statement.