SOS chains break as soon as either:
A) The battle ends.
You can end the battle by running away, causing the wild Pokémon to run away with a move like Whirlwind, KOing every wild Pokémon on the battlefield, or catching a Pokémon.
B) You KO the last Pokémon in a chainable species.
For example, if you're SOS chaining Carbink and a Sableye appears, and you KO the Carbink, the chain will end because Sableye cannot call for an ally. This does not apply to Pokémon in the same evolution family. For example, if Magikarp calls a Gyarados, Gyarados can keep the chain going.
In your case, the wild battle ended because you KO'd all wild Pokémon. This means that the chain ended as well.