All of this is specific to individuals who have transgressed at that time. Islam is very very clear on the idea that "No soul burdened with sin will bear the burden of another"
As mentioned in 39:7 "If you disbelieve, then ˹know that˺ Allah is truly not in need of you, nor does He approve of disbelief from His servants. But if you become grateful ˹through faith˺, He will appreciate that from you. No soul burdened with sin will bear the burden of another. Then to your Lord is your return, and He will inform you of what you used to do. He certainly knows best what is ˹hidden˺ in the heart." And many other places: 17:15, 6:164, 35:18 ...