The Prophet ﷺ said, "Allah will come to them in a form other than the one they recognize and will say, 'I am your Lord.' They will reply, 'We seek refuge in Allah from you. This is our place until our Lord comes to us. When our Lord comes to us, we will recognize Him.' Then Allah will come to them in the form they recognize."
عن النبي ﷺ قال: فيأتيهم الله في غير الصورة التي يعرفون فيقول: أنا ربكم، فيقولون: نعوذ بالله منك، هذا مكاننا حتى يأتينا ربنا، فإذا أتانا ربنا عرفناه، فيأتيهم الله في الصورة التي يعرفون.
Bukhari narrated it in the Book of Tawhid (7437) and Muslim in the Book of Iman (182), both from the hadith of Ibrahim bin Saad, from Ibn Shihab, from Ata bin Yazid Laythi, from Abu Hurairah, who mentioned it in a long hadith. See the chapter, "The Sirat Is a Bridge over Hell," among the chapters on the Last Day. See the rest of the hadiths in the chapter on the Prophetﷺ seeing his Lord in a dream.