According to this answer Winter Bash 2016 - All Hats
The hat '24' is earned by earning a gold badge. 4 days ago I earned one, but never received the hat. Can anyone tell me the reason?
That is the 2016 version. This year’s version is here:
This year, the gold badge hat is “foot of the rainbow.”
Your profile on the Leaderboard shows that you do have that one. So, Congrats!