Walls can not protect you from dhijadists either, the mortars take out the city- and besieging starves it out. In sudan- a "walled and ditched" city recently fell to the djandjhawid.. https://www.iss.europa.eu/publications/commentary/fall-el-fa...
Alone, no. But the fact that modern militaries still build them around bases in insecure areas should give you a moment's pause before dismissing them entirely.
They give you time though. It's certainly not perfect, but no wall ever was. You could scale the old wall with a ladder if you wanted to, but it slowed you down and that gave the defenders time to do something about that.
Of course no fortification can withstand overwhelming force indefinitely, but el-Fasher held out 1.5 years while completely surrounded, which isn't too shabby. (Here's a map from a year prior: https://upload.wikimedia.org/wikipedia/commons/archive/5/52/... It's the small pink blob of army-controlled territory labeled "Al-Fashir" within the gray mass of the RSF.) And the RSF are a formerly government-affiliated civil war faction with a lot more firepower than jihadist militias like JNIM or ISSP.
If some trenches and an earth wall turn a short raid into a long siege, that at least gives the army some time to send reinforcements and attack the besiegers.