And when We decreed for him [i.e., Solomon] death, nothing indicated to them [i.e., the jinn] his death except a creature of the earth eating his staff.1 But when he fell, it became clear to the jinn that if they had known the unseen, they would not have remained in humiliating punishment.2
Translation: Saheeh International (English)
1 Upon which he was leaning at the time of his death. A termite continued to gnaw into the stick until it collapsed under his weight.
2 i.e., hard labor. This verse is evidence that the jinn do not possess knowledge of the unseen, which belongs exclusively to Allāh (subḥānahu wa taʿālā).
When we decreed for Solomon to die, the Jinn did not realise he had passed away until the woodworms had eroded away the staff he was leaning on. When he fell it became clear to the Jinn that they do not know the unseen/ghayb, as if they did, they would have not remained subdued, continuing to carry out the difficult tasks imposed upon them.