Is there a source in Judaism that indicates that Moshiach (Ben David, not Ben Yosef) will die before having fulfilled his role and then return to posthumously achieve it?
In The Yerushalmi Brachos daf 17:1 (see Eicha Rabbah 1:51 as well ) says : The Rabbanan said if Mashiach is from the living David is his name, if he is from the dead, David is his name,
R' Tanchuma says the reason is based off Tehillim 18:51.
Rabbi Yehoshua ben Levi said his name is Tzemach.
Rabbi Yuden ben R' Aivo said his name is Menachem.
However, it is brought that Mashiach(kingship) will come from Shlomo Hamelech(Rambam Mitzvah Lo Taseh 362 ) ,and it is also brought down that the soul of Mashiach will be from that of Moshe( Ohr Hachaim 49:11 ) Meaning the soul of Mashiach is from great people not necessarily that these people are Resurrected.
Multiple sources say that the Moshiach will be hidden for some time, and come back and be revealed
Rashi on Daniel 12:12 says
Moshiach will be revealed, concealed, and then revealed again
Also Midrash Rabba Bamidbar 11:3
Rabbi Berachia in the name of Rabbi Levi said: Just like the first redeemer, Moshe, revealed himself to the Jews and then concealed himself, similarly the final redeemer will reveal himself and then conceal himself, and then return and reveal himself again
אמר רב אי מן חייא הוא כגון רבינו הקדוש אי מן מתיא הוא כגון דניאל איש חמודות
Said Rav: If he [Mashiach] is from the living, he is like our great teacher [R' Yehuda HaNasi]. If he is from the dead, he is like Daniel, greatly beloved man [i.e. the Biblical Daniel].
The question asked was, "will die before having fulfilled his role and then return" [italics mine]. Some here have brought Midrashim that might perhaps be understood that it is possible for that to happen. I would guess that the right answer is that there is no source at all that predicts that it will happen, since the notion [espoused by Christians, of course] was treated with universal scorn by all Jews, Chabad and non-Chabad alike, until recently.
The only reason the question is being asked is that so many people from Chabad got pulled into this position by events. For something like that one needs Bayesian Inference: What did one estimate as the likelihood of this happening, before events made it the only possibility that fits with one's prior assumptions, the only chance to still be right. If that likelihood was ridiculously small (as anyone from Chabad would have said emphatically in 1993), what one is supposed to do is re-evaluate one's priors, not follow them into further results that would earlier have been rejected as crazy.
not exactly as you are asking. There is no source that someone proclaimed to be moshiach vadai can die and then come back to complete their mission as moshiach. There is a notion that moshiach may be someone who has passed away. The gemara quoted from Sanhedrin 98b does show someone who has passed away may be resurrected in order to be moshiach. This should explain to you the distinction between someone being moshaich, dying, and then coming back (not valid)versus someone who has passed away being the moshiach (valid).