Mama Monk asked me the following question today, and it’s worth sharing along with the response.

And to God give the glory!  I doubt Paul thought it “glory” when beaten, jailed, run out of town, etc. but one keeps on going  on. Till that glorious day when we go on to heaven,

Now: tell me why John the Baptist did not know Jesus was the Messiah??? Like they were first cousins, the Mothers knew, etc.

But only two gospels say Jesus was baptized by John, would he not know who Jesus was??

Or was he just so miserable in jail he doubted?

The response goes a little something like this:

Hi Mom!

John the Baptist definitely knew that Jesus was the Messiah.
He knew it by the Holy Spirit when he was still in his mother’s womb (Luke 1:39-45).
He knew that Jesus was the Messiah when they met, as he told Jesus at Jesus’ baptism that he (John) needed the baptism of Jesus (the Messiah), and Jesus corrects him that this was necessary in order to fulfill all righteousness (Matthew 3:13-17).  (Jesus fully obeyed the law where we couldn’t, including the Jewish ritual of repentance and dedication that we fail to show, though just as his suffering on the cross, Jesus had no need of the forgiveness of sins.)
I do not know John’s heart, and God’s Word does not say why he sent his disciples to ask Jesus whether or not he was the Messiah.  Trying to figure it out dips into something scholars call eisegesis, a way of reading our own thoughts and suppositions into scripture instead of reacting to scripture directly.
So, I don’t know, and Scripture’s silence means that my faith does not require that information.  With that being said, let’s take a look at the passage, Matthew 11:1-19.  John the son of Zechariah sends his disciples to Jesus to ask whether Jesus is the Messiah or if there is another waiting.  I have heard three main theories as to why he did this.  Remember that scripture doesn’t say, and so I will not assume to know which theory is right.  At different times I have found different theories appealing.
Theory 1] John fully knows that Jesus is the Messiah, and he is manipulating his disciples.  He sends them to ask Jesus if he is the Lord’s anointed so that John’s disciples will receive the witness that Jesus is the Messiah.  They obviously haven’t gotten it yet or they would have started to follow Jesus instead, as we gather Andrew and some of the other disciples were John’s followers first.
Theory 2] John knew that Jesus was the Messiah but like the Jews of his age he hadn’t fully understood what the Kingdom of Heaven was going to look like.  Jesus didn’t turn around, kick Roman ass, and start an everlasting earthly kingdom right then and there.  So… maybe John had better figure out why Jesus was acting so different than many prophecies/expectations.  In this line of interpretation, Jesus’ response points to the true nature of the Kingdom of God, the blessings and healing that came as signs of God’s power and the forgiveness of sins.
Theory 3] You mentioned this one.  Some people believe that John was isolated, alone, and pretty sure he was going to get executed or die in prison.  Just because he was a prophet didn’t mean God was going to save him.  We’re pretty sure that Jeremiah was sawed in two, and other prophets and believers died in the Old Testament.  In that case, John would be in good company, and this interpretation rightly points out what Jesus says: “In this world you will have trouble, but take heart for I have overcome the world.”  Moses, Elijah, and David are all on record in Scripture as saying they were done, ready to die, and deserving it.  So it is possible that God includes John’s message and Jesus’ response to show the reality of human frailty in suffering and God’s encouraging response in Jesus’ words, so that we may also take heart in our own darker times.
I have no direct revelation to indicate which of these three interpretations is correct, or if there is a fourth that I cannot grasp 1,980 some years removed from the events in question and in a completely different culture.
I hope that answers your question well enough for now.
Your son the Monk.