Clicking that cross kicks off whatever is specified as the 'close action' within the Properties of that page. If a microflow has been set to the close action, you can debug it using the debugger. As a default, the 'x' kicks off the cancel action. There isn't a way to debug this, but what it does is rollback the entity in the window and then close the page. To get details about the error, you will need to check the console log as others have said.
If you would like some guidance on finding details about the error, check out this how-to: https://docs.mendix.com/howto50/finding-the-root-cause-of-runtime-errors