Since the heavens and the earth are not a family, and since the creation was already recounted in Gen 1, why is the toledoth formula here in 2:4, and why is there another creation account?

These two questions have the same answer, namely, this does tell the story of a sort of “family”: it is the family of “the dust of the ground,” from which Adam and Eve sprang, and this is their story. This is not, of course, an entire creation account—contrary to “critical” readers who fail to consider the whole context—but only mentions a few small details needed to contextualize the account of Adam and his activity. Indeed, if you do not recognize that the narratives, in the present chapter (beginning at Gen 1:4) as well as the following three chapters, concerns Adam and his immediate family, you will be confused about this redundant creation language. By the way, it is not about “the generations of Adam,” which actually begins at Gen 5:1, because the generations of a figure do not typically include the figure, but instead refer to those generated bythe figure. It is possible that “generations” should be rendered “offspring” or “descendants.”