In my limited experience 'failed to execute' was caused by errors in parameters. Does the country has something special like a name with a space? "new zealand" for example?
Can you test you script with only this country and troubleshoot from there?
Los miembros registrados pueden publicar, seguir actualizaciones y más. ¿Nuevo aquí? Regístrate gratis.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.