So sorry to hear about your losses
I have had a lot higher nitrates then 20 before in my tank, did some water changes right away once I realized, and luckily I didn't loose anything. The nitrates probably spiked after the fish died, doesn't seem likely to be the cause of death IMO.