Since we don't appear to have an accepted answer for Michael Moorcock's 1969 novel Behold the Man, I'm going to formally suggest it as your answer.
Except that Karl Glogauer is a neurotic and not (as best I recall) an epileptic, it seems to match what you recall very closely. It has been extensively reviewed in many places, but I will quote from the Wikipedia summary:
The story begins with Karl's violent arrival in the Holy Land of AD 28, where his time machine, a womb-like, fluid-filled sphere, cracks open and becomes useless. By interpolating numerous memories and flashbacks, Moorcock tells the parallel story of Karl's troubled past in 20th century London, and tries to explain why he's willing to risk everything to meet Jesus. We learn that Karl has chronic problems with women, homosexual tendencies, an interest in the ideas of Jung, and many neuroses, including a messiah complex. [...]
He then makes his way to Nazareth in search of Jesus. When he finds Mary and Joseph, Mary turns out to be little more than a whore, and Joseph, a bitter old man, sneers openly at her claim to have been impregnated by an angel. Worse, their child Jesus is a profoundly intellectually disabled hunchback who incessantly repeats the only word he knows: Jesus, Jesus, Jesus. Karl, however, is so deeply committed to the idea of a real, historical Jesus that, at this point, he himself begins to step into the role, gathering followers - carefully choosing ones whose names are identical with those attested in the Gospels, repeating what parables he can recall, and using psychological tricks to simulate miracles. [...]
In the end, determined to live the story of Jesus to its decidedly bitter end, he orders a puzzled Judas to betray him to the Romans, and dies on the cross. [...]