In the Catch block, use the “Take Screenshot” activity from the UI Automation package instead of the Modern activity, as it captures the actual screen. Set the screenshot output to a variable and then use the “Save Image” activity to save the screenshot to a file or log it. This ensures that you capture the screen where the error occurs, rather than the UiPath robot’s screen.
Found helpful, mark as a solution. Thanks