By swapping the filters you took out a vast majority of the beneficial bacteria. These bacterias consume the ammonia and nitrites. The cloudyness you experienced was a bacteria bloom. It is likely the ammonia and nitrites skyrocketed and killed your fish. You should test the parameters. Unfortunately, unless the old filter media is still wet, you will have a mini cycle. If you want to try to save the rest, go buy a packet of bio spira and put that in. It will readd the bacteria you are now missing. When you add the bio spira, also put any fish you plan to add at the same time. If you want 4 more tiger barbs, add them at this time with the bio spira.
In the future, when replacing filter media or entire filters, it is best to run them at the same time, and gradually remove the old. You can leave old filter media in the new filter for a few weeks until the bacteria have grown in the new filter.