https://theisraelbible.com/ishmaels-repentance/
...Rabbi Shlomo ben Yitzchak, known as Rashi (11th century France), the greatest and most studied of all Jewish Bible commentators, comments that the fact that Isaac, the younger son, is mentioned before Ishmael, the elder, implies that Ishmael gave precedence to Isaac as Abraham’s primary son. This is viewed as evidence that Ishmael repented...
He repented toward the end of his live but the “wild ass” description applies to the nation he founded no to his entire life as an individual. We see that he was well behaved before this when he accompanied Abraham to the Akeida (binding of Isaac).