Great human beings are routinely vastly misunderstood. For example, here is the gist of what Plato wrote about the cause of the well-known ancient Greek philosopher Socrates’ persecution and death, in his Apology:
At his trial, Socrates is accused of two things: impiety (asebeia) against Athens’s gods, by introducing new gods, and corruption of Athenian youth, by teaching them to question the status quo. He is accused of impiety because the Oracle at Delphi said there was no wiser man in Athens then Socrates, and Socrates knew he was not wise. After hearing that, he questioned every man he met to find a wiser man than he.
The corruption charge, said Socrates in his defense, was because by questioning people in public, he embarrassed them, and they, in turn, accused him of corrupting the youth of Athens by the use of sophistry. (“What Was the Charge Against Socrates?,” N. S. Gill, ThoughtCo., 11-28-18)
That sounds very familiar. Jesus’ enemies (mostly the scribes and Pharisees) accused Him of blasphemy and impiety because He claimed to be God, and also the Messiah. This upset the apple cart (to put it extremely mildly), so they sought to kill Him:
John 5:15-18 (RSV) The man went away and told the Jews that it was Jesus who had healed him.  And this was why the Jews persecuted Jesus, because he did this on the sabbath.  But Jesus answered them, “My Father is working still, and I am working.”  This was why the Jews sought all the more to kill him, because he not only broke the sabbath but also called God his Father, making himself equal with God.
John 10:30-36 “I and the Father are one.”  The Jews took up stones again to stone him.  Jesus answered them, “I have shown you many good works from the Father; for which of these do you stone me?”  The Jews answered him, “It is not for a good work that we stone you but for blasphemy; because you, being a man, make yourself God.”  Jesus answered them, “Is it not written in your law, `I said, you are gods’?  If he called them gods to whom the word of God came (and scripture cannot be broken),  do you say of him whom the Father consecrated and sent into the world, `You are blaspheming,’ because I said, `I am the Son of God’
Matthew 26:63-66 . . . And the high priest said to him, “I adjure you by the living God, tell us if you are the Christ [the Messiah], the Son of God.”  Jesus said to him, “You have said so. But I tell you, hereafter you will see the Son of man seated at the right hand of Power, and coming on the clouds of heaven.”  Then the high priest tore his robes, and said, “He has uttered blasphemy. Why do we still need witnesses? You have now heard his blasphemy.  What is your judgment?” They answered, “He deserves death.” [clearly applying to himself the famous messianic passage, Daniel 7:13]
John 7:1 After this Jesus went about in Galilee; he would not go about in Judea, because the Jews sought to kill him.
John 19:7 The Jews answered him, “We have a law, and by that law he ought to die, because he has made himself the Son of God.”
Jesus, like Socrates, went against the established religious orthodoxy and the corrupt status quo (even using Socrates’ own famous questioning “method”), and had to be killed for it. They started saying He was demonically possessed and that He cast out demons by demonic power (Mk 3:22), to which Jesus retorted, “a house divided against itself cannot stand” (Mk 3:25).And people said “He is beside himself” (Mk 3:21) because Jesus had (heaven forbid!) healed people (Mk 3:1-10). And (also very much like Socrates’ case) people (filled with pride then as now, if they lose an argument or are shown to be wrong) didn’t like how He overcame them with His socratic questioning:
Luke 14:5-6 And he said to them, “Which of you, having a son or an ox that has fallen into a well, will not immediately pull him out on a sabbath day?”  And they could not reply to this.
Mark 3:1-4 Again he entered the synagogue, and a man was there who had a withered hand.  And they watched him, to see whether he would heal him on the sabbath, so that they might accuse him.  And he said to the man who had the withered hand, “Come here.”  And he said to them, “Is it lawful on the sabbath to do good or to do harm, to save life or to kill?” But they were silent.
Luke 20:19-26 The scribes and the chief priests tried to lay hands on him at that very hour, but they feared the people; for they perceived that he had told this parable against them.  So they watched him, and sent spies, who pretended to be sincere, that they might take hold of what he said, so as to deliver him up to the authority and jurisdiction of the governor.  They asked him, “Teacher, we know that you speak and teach rightly, and show no partiality, but truly teach the way of God.  Is it lawful for us to give tribute to Caesar, or not?”  But he perceived their craftiness, and said to them,  “Show me a coin. Whose likeness and inscription has it?” They said, “Caesar’s.”  He said to them, “Then render to Caesar the things that are Caesar’s, and to God the things that are God’s.”  And they were not able in the presence of the people to catch him by what he said; but marveling at his answer they were silent.
Matthew 21:23-27 And when he entered the temple, the chief priests and the elders of the people came up to him as he was teaching, and said, “By what authority are you doing these things, and who gave you this authority?”  Jesus answered them, “I also will ask you a question; and if you tell me the answer, then I also will tell you by what authority I do these things.  The baptism of John, whence was it? From heaven or from men?” And they argued with one another, “If we say, `From heaven,’ he will say to us, `Why then did you not believe him?’  But if we say, `From men,’ we are afraid of the multitude; for all hold that John was a prophet.”  So they answered Jesus, “We do not know.” And he said to them, “Neither will I tell you by what authority I do these things.
Matthew 21:45-46 When the chief priests and the Pharisees heard his parables, they perceived that he was speaking about them.  But when they tried to arrest him, they feared the multitudes, because they held him to be a prophet.
So I submit that this is why Jesus was unpopular in some circles (the same ones that had Him killed), and this should not surprise anyone. Great men and women are often persecuted up to and including death. The parallels between Jesus and Socrates are striking, but not shocking at all, with even a rudimentary knowledge of history and the usual prominent flaws of fallen human nature (jealousy, pride, arrogance, lust for power, outmoded and corrupt traditions, excessive desire for fame and adulation, etc.).
Photo credit: Jesus in the House of Annas (1803), by José de Madrazo y Agudo (1781-1859) [public domain / Wikimedia Commons]