I think the optics were bad for Starmer because he said about protecting Muslim communities three days after three white girls had been murdered. Of course the Muslim communities need protecting if they are under attack, but choose your words carefully.
He wasn't saying we should protect Muslim communities in response to three white girls being murdered. He was saying it in response to hundreds of violent thugs setting fire to mosques and beating up brown people over something that had nothing to do with them. How can the optics around that be bad unless you're totally thick? Of course he should say something about it.
He's the Prime Minister, he can deal with more than one issue at once. He spoke out on multiple occasions to express sorrow, disgust and sympathy over what happened in Southport. That doesn't mean he has to stay quiet about everything else in the meantime or allow an entire community of people (of which many are also children) to be thrown under the bus by the absolute dregs of society.