1) Embarassing elements surely haven't deterred non-eyewitnesses for converting any more than they deter people today from converting.
2) People use these embarassing passages as proof that the story must be true. Why assume that the person who invented the story didn't place them there for that reason?
3) Some of them serve an obvious purpose: Peter's denial of Jesus reassures people before the possibility of faltering. Thomas' doubt is meant as a self-insert device (even the doubters ended up believing) and an obvious prelude to the gaslight-tier "response" to the obvious counter argument: "ok well Thomas was given some proof, but it's actually better to believe without proof". And so on and so forth.
4) Texts that the yahwist admits are fabricated contain obviously embarassing passages (Infancy Gospel of Thomas is one). Yet they are made up. Whether all embarassing passages are devices, or simply boil down to the author not being very smart, everyone can have their opinion I guess.