Twitter/X closed shop because, after stating that they would not comply with these requests, the judge threatened to jail every Twitter/X employee in brazil in retaliation. So to avoid putting these employees/people in danger they chose to immediately close all offices.
Something similar happened in Argentina with twitter as well I believe, and in that case they relocated most of the employees and their families via political asylum in Brazil at the time, if i'm not mistaken.