As the jinn were all subjected to Sulaiman pbuh and he used to command them to do things for him. And Whoever did not obey would be tortured. Had they known the unseen, they would have known that Sulaiman had died while he was standing in his shrine praying and leaning on his cane, and they would have been set free. But they did not know and they waited there while (they thought ) he prayed until the termites ate his cane and he fell.
(When We decreed Solomon’s death, nothing indicated to the ˹subjected˺ jinn that he was dead except the termites eating away his staff. So when he collapsed, the jinn realized that if they had ˹really˺ known the unseen, they would not have remained in ˹such˺ humiliating servitude.) Saba 34: 14
كان سليمان عليه السلام يأمر الجن أن يعملوا له أشياءً و كانوا مجندين له بإذن الله .
لما مات سليمان عليه السلام و هو واقف متكئًا على عصاه و هو يصلي في المحراب, كان الجن ينتظرون أن يفرغ من صلاته. ولو أنهم عرفوا الغيب لما بقوا في الذل و كانوا تحرروا. لكنهم لم يعرفوا إلى أن أكل الدود عصاه فوقع على الأرض.
( فَلَمَّا قَضَيْنَا عَلَيْهِ الْمَوْتَ مَا دَلَّهُمْ عَلَىٰ مَوْتِهِ إِلَّا دَابَّةُ الْأَرْضِ تَأْكُلُ مِنسَأَتَهُ ۖ فَلَمَّا خَرَّ تَبَيَّنَتِ الْجِنُّ أَن لَّوْ كَانُوا يَعْلَمُونَ الْغَيْبَ مَا لَبِثُوا فِي الْعَذَابِ الْمُهِينِ )
سبأ 34: 14