Ecto does not return a list for an aggregate function (via fragment)

That’s because in the first one ARRAY_AGG returns a list of integer, which are considered charlist in Elixir: https://elixir-lang.org/getting-started/binaries-strings-and-char-lists.html#charlists

The second version returns tuples so that’s not an issue.