NXP-11632: Clean up usage of list.toArray in layout code