(is the creation of the heavens and the earth, and whatever moving creatures He has dispersed in them both.) means, whatever He has created in them, i.e., in the heavens and the earth.
مِن دَآبَّةٍ
(and whatever moving creatures) this includes the angels, men, Jinn and all the animals with their different shapes, colors, languages, natures, kinds and types. He has distributed them throughout the various regions of the heavens and earth.
وَمَا أَصَابَكُم مِّن مُّصِيبَةٍ فَبِمَا كَسَبَتْ أَيْدِيكُمْ وَيَعْفُو عَن كَثِيرٍ (And whatever hardship befalls you is because of what your own hands have committed, while He overlooks many [ of your faults ].... 42:30) means exactly the same. Sayyidna Hasan ؓ has narrated that when this verse was revealed, the Holy Prophet ﷺ said "I swear by the Being Who holds my life, that anyone who gets scratched by a piece of wood, or his nerve shivers or his step falters is all due to his sins, and Allah Ta’ ala does not punish for every sin, rather the number of sins He overlooks far exceeds those for which any punishment is given." Maulana Ashraf Ali Thanavi (رح) has stated that just as the physical hardships and tortures befall due to sins, the inner ailments are also caused by sins. One sin committed by a person becomes the cause for getting involved in other sins. Hafiz Ibn Qayyim has written in his book Ad-Dawa-'ush- Shafi that one prompt punishment of a sin is that one gets involved in other sins; similarly the prompt reward of a virtuous deed is that it attracts another virtue. Baidawi and others have stated that this verse is specifically meant for those people who are likely to commit sins. The hardships and the troubles that befall prophets who are innocent of sins, children who have not reached the age of puberty and mad persons, who do not commit any sin, are not covered by this verse. There are other reasons for them, for example, they are upgraded in their rewards. And in reality a man cannot fathom the depths of wisdom behind them. (Allah knows best).
It is proved from some narrations of Hadith, as reproduced by Hakim in Mustadrak and by Baghawi on the authority of Sayyidna ` Ali ؓ that those sins for which punishment is given in this world are forgiven for Muslims in the Hereafter. (Mazhari)
Tazkirul Quran
Maulana Wahiduddin KhanOn ayahs 29–30
We observe that when a farmer scatters seeds, he also has the power to reap the harvest therefrom. This observation is indicative of the fact that God too can marshall all His dispersed creations and gather them in His Court where the future of humanity will be collectively decided. For the Creator for whom it was possible to create and spread His creations far and wide, why should it be impossible to collect and re-assemble them after death?
Uthmani text of the Madinah mushaf (King Fahd Complex). Translation: Saheeh International. Tafsir via Quran.com.