Definitely the type of thing a unit test is supposed to catch when you have a project as large, well-funded, and important as Facebook. Still, bugs of this type have been exceedingly rare, so I suppose one is bound to happen eventually.
All bugs are shallow with a billion users. The infrequency of this kind of bugs, as you say, is a testament to hard work on Facebook’s side.
I suspect it's more of an issue of code review. Hypothetically both fields are in the same object and the coder used the wrong field. A unit test could totally be in place doing it's job but you just have bad business logic, that no one caught.... who knows though :)