Thank you for posting your question in Microsoft Q&A.
Based on your description, I understand you have considered to configure the "X" button on Office.js dialog in Exchange sever 2019 . We are glad to assist you this part.
From my perspective, an offline setup might not being fully configured, which can cause elements like the "X" (close) button in the Office.js dialog to appear as an empty box.
If it possible, could you refer Use the Office dialog API in your Office Add-ins - Office Add-ins | Microsoft Learn to close this dialog via js:
dialog.close();
I have found relevant article that might help:
If we are misunderstanding or haven't reach out your main point, please let me know.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.