Jesus doesn’t advocate violence. What he advocates is truth, justice, mercy. These are all things that the church has applied in different forms over her history.
Jesus left the church the authority to apply these virtues. My point by citing Mathew is that there are consequences for heresy, just as there are consequences for all sins. Jesus left the church in charge of applying those consequences in order to protect the souls of those impacted.
Again another scripture that demonstrates this.
2 Peter 2,1
“But false prophets also arose among the people, just as there will be false teachers among you, who will secretly bring in destructive heresies, even denying the Master who bought them, bringing upon themselves swift destruction.“