I use Qantas website to get the AA reference code (although I have never tried it with LATAM, but other airlines have worked well).
Also AA's website may not complete the association on the first try, but it always seem to work on the 2nd try about an hour later.
Good luck.