Sorting array for deterministic failure messages

The tables_are_namespaced function had an issue where an internal
List was not sorted, causing failure messages to stringify it
into a list with unknown order.

Also added another test table to make the tests increase the number of
cases covered.