Moreover, if the early Church had simply invented authorship to lend credibility to these texts, they likely would have chosen more prominent apostles like Peter or James.
Of course, there already were Gospels of Peter and James, and they were very popular.
While this is an interesting interpretation, it lacks solid historical evidence. The idea of a Messiah ben Joseph is not attested in Jewish writings until much later, primarily in rabbinic literature.
(1) Messiah bar Ephraim in the Targums | David C Mitchell - Academia.edu
Jesus reinterpreted this expectation in a radical way, claiming that His own body was the true Temple (John 2:19-21)
The expectation that a Messiah would build the temple is again from Zechariah. 6:
12Then say to him, ‘The LORD of armies says this: “Behold, there is a Man whose name is [f]Branch, for He will [g]branch out from where He is; and He will build the temple of the LORD. 13Yes, it is He who will build the temple of the LORD, and He who will bear the majesty and sit and rule on His throne..."
This Is also where the 30 pieces of silver element comes from.
On this topic see an old thread I did.
Temple Talk.
In short it seems at an early stage this tradition was altered. The statement was perceived as a Messianic claim, but as time went on it became necessary to adjust this element. Matt and Mark distance Jesus from the statement by saying it was a lie, but the Gospel John instead has him say it but turns it into a metaphor.
Sorry I have trouble with the quote function sometimes.