Connectors are part of the Shapes and by default, Shapes' ZIndex is set to 2 and Connections ZIndex is set to 1 via style. But when you are attaching a connection, it's essential that the connection is on top of the shapes and we are controlling / ensuring this in code. Imagine trying to attach a connection but unable to see it because it is behind the shapes.
By design in normal mode (Pointer Tool) shapes are on top of connections.
By design in connection manipulation mode (Connector Tool or simply when attaching / detaching connection) connections are on top of the shapes.