Hello Pietro,
Thank you for reaching out. Although, AgeRange and Gender can be used as targeting criteria on an ad group, I would recommend referring to the Criteria Usage Guide to check if you are allowed to use a particular criteria on your ad group type (search, display etc). A complete list of codes for gender and age range targeting is available on this page. Could you please confirm if you are trying to target the allowed ad group and still observing the same error? If yes, could you please share the complete request and response logs along with the client customer id for me to investigate this further on my end and assist you better?
P.S. Please use Reply privately to author option while sharing the details for investigation.
Regards,
Nikisha Patel, Google Ads API Team