TL;DR: The first phrasings are so unidiomatic to be ungrammatical, unless specifically meant for a reason.
More precisely, we have here a construction with a so-called “unaccusative” verb. You can see more about them in the linked article, but the gist is that in Italian there are two classes of intransitive verbs, the “unergative” ones, where the subject is an actual subject (lavorare, camminare, ridere, dormire...) and the “unaccusative” ones, where the grammatical subject is a person or object to which something just happens, so to say (arrivare, cadere, scoppiare, sparire...).
Among the tests to distinguish them, there is the auxiliary verb used: avere for the unergative verbs (Mario ha dormito), essere for unaccusative ones (Mario è arrivato).
This said, one of the properties of unaccusative verbs is that they
hanno il soggetto dopo il verbo in costruzioni non marcate, come si osserva in (5) a.-c. ..., proprietà generalmente non condivisa dal soggetto dei verbi inergativi (5 d.):
(5) a. sono arrivati i libri
b. sono partiti tutti
c. è morto il bisnonno
d. * hanno dormito i bambini
that is, unless we are explicitly, almost emphatically, talking about the books, everybody, or the great-grandfather, the usual construction is the one with the subject after the verb.
So, in our examples, the phrasing “Quarant'anni sono già passati” would be used if quarant'anni were our actual topic. Say, I'm saying that forty years would be a nice interval to wait for something, and you interject: “Quarant'anni sono già passati”. But in almost any other context, by far the most usual phrasing is “Sono già passati quarant'anni”.