Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:21:82

And of the devils were those who dived for him and did work other than that. And We were of them a guardian.  

And, We disposed, of the devils some that dived for him, plunging into the sea and bringing out of it jewels for Solomon, and performed tasks other than that, that is, other than diving, such as building and otherwise. And We were watchful over them, lest they should spoil what they had made, for whenever they completed a task before nightfall, they would ˹invariably˺ spoil it, unless they were occupied with some other ˹task˺.
القرآن:٢١:٨٢

وَمِنَ الشَّيَاطِينِ مَنْ يَغُوصُونَ لَهُ وَيَعْمَلُونَ عَمَلًا دُونَ ذَٰلِكَ ۖ وَكُنَّا لَهُمْ حَافِظِينَ  

{و} سخرنا {من الشياطين من يغوصون له} يدخلون في البحر فيُخرجون منه الجواهر لسليمان {ويعلمون عملاً دون ذلك} أي سوى الغوص من البناء وغيره {وكنا لهم حافظين} من أن يُفسدوا ما عملوا، لأنهم كانوا إذا فرغوا من عمل قبل الليل أفسدوه إن لم يشتغلوا بغيره.