Hi Alejandro,
Thank you for reaching support. It is possible that some groups may not have keywords statistics and this could be the reason you observe the discrepancy in the two reports.The Keywords Performance report includes all statistics aggregated at the keyword level, one row per keyword whereas the Ad Group Performance report includes all stats aggregated by default at the ad group level, one row per ad group.If this doesn't address your concern,could you please share your account Id and queries for both the reports,so I can further investigate from my end? Please reply using the Reply privately to author option.
Regards,
Nikisha Patel, Google Ads API Team