Castillo's nationality became a long-running matter of dispute. In 2017 he was separated from the Ecuador under-20 squad after allegations that he had been born in Tumaco, a Colombian city near the border with Ecuador. In January 2019 he was accused of adulterating his birth documentation, and the issue kept him out of Ecuador's national team until 2021. An investigation opened in February 2021 to determine whether he was Ecuadorian or Colombian, and on 24 April 2021 his Ecuadorian nationality was confirmed. In May 2022 the Chilean Football Federation filed a complaint with FIFA, and FIFA closed its investigation on 10 June 2022, confirming Ecuador's place in the World Cup. FIFA's Appeals Commission later reopened the matter and again ruled in Castillo's favour in October 2022. Spanish newspaper Marca also published audio and birth certificates that showed discrepancies in his details, which were reported widely.