This mantra of “it’s not Islam” is much like a Buddhist mantra, a religious chant mention to clear the mind. It’s increasingly chanted as it becomes ever more obvious that it is Islam that’s at the core of the problem. Without the religious core, the fighters would not be so ruthless or willing to die.
You are right. It’s a mantra. They just keep repeating it over and over until they believe it. Then once they believe it, no amount of evidence to the contrary will ever convince them otherwise.