The Messenger of Allah ﷺ used to supplicate with these words and say them in times of distress. He then mentioned the same as the hadith of Muaz bin Hisham from his father from Qatada, except that he said, "Lord of the heavens and the earth."
و حدثنا عبد بن حميد أخبرنا محمد بن بشر العبدي حدثنا سعيد بن أبي عروبة عن قتادة أن أبا العالية الرياحي حدثهم
أن رسول الله ﷺ كان يدعو بهن ويقولهن عند الكرب فذكر بمثل حديث معاذ بن هشام عن أبيه عن قتادة غير أنه قال رب السماوات والأرض