Tens of thousands of people, most of whom are women, could be owed money after a HMRC mix-up.