Its hard to pinpoint the exact reason but with such a small tank it could be stress and water conditions. Cory's should be kept in groups of six with no smaller of a 20gal tank.
Sure you water conditions are fine right now but with such a small tank parameters can change almost instantly and cause large ammonia spikes which burn and stress your fish.
Also you said you recently changed the substrate, that wouldve caused a micro crash in the tank by removing a huge amount beneficial bacteria. Having a spotless aquarium actually hurts more than most people think.
That would be my biggest guess on the issues is a combination of tank size causing water issues, changing the established substrate causing water issues, fish being stress from water conditions and tank size, fishes immune system failing due to all the above.
Best recommendation. By a 10gal tank if you only want 3 corys and a few mid swimming fish (such as tetras) or a 20gal and 6 corys plus a few other fish to help them be happy. Cory's are group fish, they love being together. Then just properly cycle the tank, then 30% water changes weekly.