Chief executive Mark Zuckerberg said it was one of the most difficult changes in Meta’s history.