Therefore, in this case the magnetic field does positive work.
How is this contradiction possible?
The force given by the formula
$$
\vec F= i \vec{l} \times \vec B
$$
is magnetic force acting on the current forming particles - mobile electrons. The formula is accurate provided the wire does not move so the current forming particles follow the wire element $\vec{l}$. If so, the work done by magnetic forces on the electrons is zero and since the wire does not move, work done by magnetic forces on the wire is also zero.
If the wire element is allowed to move, mobile electrons no longer move along $\vec{l}$, but their velocity is influenced also by the motion of the wire. In such case above formula generally does not give correctly magnetic force on the wire element.
Except for when the motion of the wire is very slow (slower than the average speed of electrons with respect to the wire). Then, the formula gives accurately magnetic force on the electrons. Electrons move each differently and always perpendicularly to the experienced magnetic force, so no work is done by magnetic forces on them. However, in macroscopic description the confinement of the electrons within the wire means any external force $\vec{F}_{e}$ (due to external bodies, magnetic field...) they experience in a small element of the wire is accompanied by internal force $\vec{F}_{i}$ whose component perpendicular to the wire cancels the same kind of component of the external force. This can be assumed to be ordinary mechanical force obeying principle of action and reaction, so the electrons push back on the wire. The result is, that due to magnetic field the electrons themselves make the wire move and work on it. When the wire element $\ell$ gets displaced by $\Delta \vec s$, the expression
$$
i \vec{l} \times \vec B \cdot \Delta \vec s
$$
gives net work done on the wire by the electrons. The magnetic field thus enables the moving electrons to give kinetic energy (or work, if done steadily) to the rest of the wire.
The role of magnetic field is similar to the role of normal force of ground, when a human is in the process of standing up. No work is done by the ground; all the work is done by internal forces in the human body. But the normal force of the ground is necessary to make this possible. Similarly, magnetic forces do not work, but they make possible work to be done by the electrons on the rest of the wires.