In 24.3 the DISTINCT keyword is available with ARRAY_AGG, but sometimes the planner can generate an invalid plan, which results in the error “Failure while planning to query. Please remove ARRAY_AGG(DISTINCT) and try again.”
The fix (DX-85492) will be in releases v24.3.2 and 25. Please let us know if any questions.