The ship was navigating the narrow Miami River and veered too close to one of the edges, resulting in the collision with the barrier.