On my first day of freshman Intro to Philosophy class, the instructor opened with this: "What is truth?" -- pause for effect -- "What is truth? Do you know who first said that? Jesus. He was on trial at the time, charged with a capital crime, but that's what he said when he stood before the Roman governor: 'What is truth?' I know, I know, Pilate must have been like, You're on trial, man! I get to ask the questions! But Jesus had the right idea . . ."
And then he segued into whatever philosophical topic was first on the agenda. And no one said anything. Even I, who I'm sure was well above the average in terms of biblical literacy -- and who was generally that annoying kid who just had to raise his hand every single time the professor said anything wrong -- didn't say anything. Fact is, he rattled off the story so smoothly and naturally that for the moment I wasn't entirely sure it was wrong. The thought, "Wasn't it Pilate who said that?" did cross my mind, but not with sufficient conviction. I even entertained the idea that maybe one gospel put the words in Pilate's mouth and another in Jesus'. All in all, I just wasn't sure enough the lecturer was wrong to risk making a fool of myself by contradicting him. And neither was anyone else.
Nor do I think the lecturer was an idiot or was intentionally misquoting Jesus. He was simply telling a Bible story as he remembered it. The question "What is truth?" made him think, Hey, that's in the Bible, isn't it, when Jesus stands before Pilate? -- and he didn't bother to look it up because he knew it.
It's surprisingly easy to remember lines from a dialogue, and remember who is involved, but misremember who said which lines. (See my post "Socrates doesn't have feathers," and the self-correction in the comments, for an example of my making the same kind of mistake.)
And I don't think these errors are random. There's a natural predisposition to attribute the most memorable lines to the most memorable people. We tend to assume that Jesus, not Pilate, would produce quotable quotes that you can incorporate into an Intro to Philosophy lecture.
It's something to keep in mind when we read the Gospels. Some of the lines attributed to Jesus may well have really been said, in a conversation with Jesus, but Jesus may not have been the one who said them. In fact, it would be astonishing if no such errors had found their way into the record.