Emerging market countries that have improved institutions and attained intermediate levels of institutional quality have experienced severe financial crises following capital flow reversals. However, there is also evidence that countries with strong institutions and deep capital markets are less affected by external shocks. We reconcile these two observations using a calibrated DSGE model that extends the financial accelerator framework developed in Bernanke, Gertler, and Gilchrist (1999). The model captures financial market institutional quality with creditors. ability to recover assets from bankrupt firms. Bankruptcy costs affect vulnerability to sudden stops directly but also indirectly by affecting the degree of liability dollarization. Simulations reveal an inverted U-shaped relationship between bankruptcy recovery rates and the output loss following sudden stops. We provide empirical evidence that this non-linear relationship exists.