Please be more specific. But I think you should check for any asynchronous operation, like functions in update or background task, or batch input update after execution (look after the commits).
You should check it because looks like that the debugger is holding the main process while some asynchronous operation is being completed. When you execute it without the debugger, the main process get completed before the asynchronous operation.