• Constructed BiO2ex/NaNbO3 heterojunctions via hydrothermal method, achieving 2.6-fold and 3.8-fold enhancement in NH3 production rate compared to pure NaNbO3 and BiO2ex, respectively.
• BiO2ex nanosheets act as electron trappers, significantly improving charge carrier separation efficiency in the heterojunction.
• Abundant oxygen vacancies in BiO2ex facilitate N2 adsorption and activation, contributing to the enhanced photocatalytic nitrogen fixation performance.
• The study provides new insights into designing efficient semiconductor heterojunctions for sustainable ammonia synthesis under solar light.