That is probably one of the hardest questions I've ever been asked about fish, but here goes...
Prepared fish food such as flakes and pellets are just fine for both fresh and salt water fish, but only as long as the content of the prepared food matches the fishes natural diets for long term health. Which is why there are specialized prepared foods that include sponge matter for fish like angelfish, but since most flakes and foods are shrimp based, and are dry (no freshwater content), they are a basic good staple for many species.
What I believe happened to your fish when you fed them live freshwater shrimp had to do with the freshwater content of the shrimp. Given that the shrimp hold a lot of freshwater within their bodies, the sudden, large input of freshwater into the saltwater fish most likely caused an osmotic shock, and being that freshwater is not as dense as saltwater, it makes sense that a freshwater loaded fish would rise to the surface. This is also a good reason not to feed your large predatory fish any live freshwater fish.
Charles