Problem with Curve Modifier on object array
Curve modifier needs a subdivided,  the more the better, mesh to work as expected. Instead, use Bevel object which is a bezier circle with handles set to vector to form a square. Then rotate it and make a rectangle.