Meta’s two courtroom defeats centered on different cases but both involved allegations that the company knew about its products’ harms.