And when they [i.e., those advised] forgot that by which they had been reminded, We saved those who had forbidden evil and seized those who wronged, with a wretched punishment, because they were defiantly disobeying.
Those Who breached the Sabbath were turned into Monkeys, butThose Who prohibited Their Actions were saved
Allah said that the people of this village were divided into three groups, a group that committed the prohibition, catching fish on the Sabbath, as we described in the Tafsir of Surat Al-Baqarah. Another group prohibited them from transgression and avoided them. A third group neither prohibited them, nor participated in their action. The third group said to the preachers,
("Why do you preach to a people whom Allah is about to destroy or to punish with a severe torment"). They said, `why do you forbid these people from evil, when you know that they are destroyed and have earned Allah's punishment' Therefore, they said, there is no benefit in forbidding them. The preachers replied,
The detailed discussion of the events contained in the above verses have been produced in Surah Al-Baqarah (under verses 58-60). Those interested may refer to those verses for details.
The Holy Prophet ﷺ has been asked to warn the Israelites present in his time by reminding them the events related in these verses. The events referred to in these verses are clear and require no explanation.
Tazkirul Quran
Maulana Wahiduddin KhanOn ayahs 164–165
It is a sin to do anything which God has prohibited. But to perform a prohibited act by attempting to legalize it through some trick amounts to adding insult to injury. By violating the rule of the Sabbath, the Jews had committed a double sin. Such people must suffer divine retribution; that is, they are deprived of the bounties which God has set apart for human beings alone. In this world such people fall from the level of humanity to the level of the animals.
Uthmani text of the Madinah mushaf (King Fahd Complex). Translation: Saheeh International. Tafsir via Quran.com.