Just saw this - and adding up everything - the fish were observed together for a long time - they are small in a relatively large tank - with seemingly adequate flow and what sounds like a sponge filter - which should provide plenty of oxygenation. And both were doing poorly within a very short period after addition - which has to be either a toxin in the water or osmotic shock. My guess would be osmotic shock as multiple others have said - but I would think about anything in the room or the preparation of the QT tank that may have introduced something that could have been toxic to the fish.
There are many good ideas above how to avoid this - the main think you can do is to make sure your own salinity is actually correct as well
There are many good ideas above how to avoid this - the main think you can do is to make sure your own salinity is actually correct as well

