Substantial investments in renewable energy technology are needed to achieve sustainable development goals, reduce reliance on fossil fuels, and ensure access to clean and stable energy. However, securing funding for these initiatives is challenging, relying heavily on extensive financial support from banks. In response to this challenge, this article establishes a relationship between market-based default risk measures, such as Distance-to-Default (DD) and Distance-to-Capital (DC), and the proportion of renewable energy in a country's total energy supply. We collected data from a sample of 1,373 international banks across 27 countries from 2009 to 2022, using an ordinary linear fixed-effect model. After reviewing the literature, we categorized the study into two homogeneous sub-panels based on income group classification (developed or emerging countries). Overall, our results indicate that increasing the share of renewable energy in a country's total energy supply significantly reduces bank default risk. For developed countries, an increase in renewable energy generation, an expansion in bank size, and a decrease in CO$_2$ emissions have positive effects on the possibility of bank default risk. On the other hand, our results show an inverse relationship for banks in emerging countries. Economic growth and bank size emerge as other significant determinants of bank default risk. To ensure the robustness of our findings, we conducted several tests, all of which validated our results. In conclusion, our study underscores the crucial role of a banking system in facilitating investments in renewable energy.