Brazilian here. This a controversial topic, so take what I say as an opinion.
Although Musk is a man child and a scumbag, he is right on this. He is not refusing to comply with local laws, he is refusing to comply with illegal, monocratic decisions from the supreme court.
It is not news that the supreme court had given themselves dictator-like powers. In this case, there is no law that mandates that a social network has to have legal representatives in the country, and there is no law that a social network has to censor specific person, unless they are commiting a crime, which of course require a investigation and the due legal process, all steps that the supreme court had ignored. Moreover, the supreme court is not persecution, so they can't just make this decision without being summoned.
They've been doing that for a while now, in the name of fighting "anti-democratic acts", which is just a faceless ghost. This is, again, based on no law whatsoever, so the supreme court had taken for themselves persecution and legislative powers, gravely hurting the separation of powers.
Disclaimer: I'm not right leaning, but I'm as libertarian as one can be
I tried DDG and Brave Search. Currently I'm using Brave Search, but it really annoys me that more often than not I have to fallback to Google to find what I want