There is no historical basis rooted in the founding era for it either: The Constitution by its own text explicitly rejects the existence of such a norm, as do several of the Federalist Papers, and the debate at the Constitutional Convention itself. The United States has a storied and continuous history prosecuting federal officials of both parties and across all branches starting in the founding era and which is unbroken through to 2022.
This article by Matt Tait thoroughly cuts through the BS about former Presidents being immune to prosecution for crimes. The media bosses want Trump back so badly that they’re spinning yarns about norms.