I think it highly likely you've messed up, but look in the small-print of both contracts.
When you change agents it is very common that you have to list those people that made offers that were not proceeded with. You do this to ensure that the second agent understands that they are excluded from any deal with the second agent being entitled to commission, in the event they come back. If they come back, as has happened, the first agent is probably due the commission.
It is possible you may now have to pay commission to both, but check the terms.