It appears from your question that you slaughtered the sacrificial animal before the Eid prayer. If that is the case, then it is not a sacrifice (udhiyah), because the condition of the sacrifice is that it should be slaughtered on the days of sacrifice, which are the day of Eid and the three following days.
It was narrated that Jundub ibn Sufyaan (may Allaah be pleased with him) said: I was present on Eid al-Adha with the Messenger of Allaah (peace and blessings of Allaah be upon him). When he had finished leading the people in prayer, he looked at a sheep that had been slaughtered and said, ‘Whoever slaughtered (his sacrifice) before the prayer, let him slaughter a sheep in place of it, and whoever has not yet slaughtered (his sacrifice), let him do so in the name of Allaah.” Narrated by al-Bukhaari, 942; Muslim, 1960.
Based on this, if this sacrifice was in fulfilment of a vow, then you have to offer another sacrifice in its stead.
But if you slaughtered it at the time of sacrifice, and you bought it with the intention of sacrificing it, then it is valid and is a sacrifice (udhiyah), even if it was damaged as the result of its fall from the roof. See also question no. (39191).
With regard to the validity of your slaughtering it, it is valid if you managed to do it before it died.
Allaah has forbidden that which has been killed by strangling, and that which has been killed by a violent blow – which is an animal that dies from a blow with a piece of wood or metal – and that which has been killed by a headlong fall – like your sacrifice – and that which has been partially eaten by wild animals. This applies if the animal dies, but if people catch up with it before it dies and slaughter it in the manner prescribed in sharee’ah, then it becomes halaal.
Allaah says (interpretation of the meaning):
“Forbidden to you (for food) are: Al‑Maitah (the dead animals — cattle — beast not slaughtered), blood, the flesh of swine, and that on which Allaah’s Name has not been mentioned while slaughtering (that which has been slaughtered as a sacrifice for others than Allaah, or has been slaughtered for idols) and that which has been killed by strangling, or by a violent blow, or by a headlong fall, or by the goring of horns — and that which has been (partly) eaten by a wild animal — unless you are able to slaughter it (before its death)”
Ibn Katheer said:
The phrase “unless you are able to slaughter it” refers to that which you are able to reach and slaughter in the proper manner when there is still evidently life in it. That refers to the phrase, “that which has been killed by strangling, or by a violent blow, or by a headlong fall, or by the goring of horns — and that which has been (partly) eaten by a wild animal”.
Tafseer Ibn Katheer, 2/11, 12
It was narrated from Ka’b ibn Maalik (may Allaah be pleased with him) that they had sheep that used to graze at Sal’ (a mountain in Madeenah): a girl of ours saw a sheep that was dying, so she broke a stone and slaughtered it with it. He said to them: “Do not eat it until I ask the Prophet (peace and blessings of Allaah be upon him).” He asked the Prophet (peace and blessings of Allaah be upon him) about that and he told him to eat it. Narrated by al-Bukhaari, 2181.
And Allaah knows best.