I have to say the absolute maximum nitrates for rams is 20. I never allow mine over 15 (I feel this gives me leeway) I like to keep them around 10. Rams really don't like having spent any time at all in Nitrate levels above 20. Try waterchanging again and try to get them down further. It is possible that being in water with nitrates at 40 has stressed them leading to a further problem.
Have you seen any bullying by the angel or the gourami at all. I have angels and rams together myself but I have 6 angels and 8 rams (Not all staying, waiting to pair off) but I will have more than one angel. Not sure if maybe the lone angel could be stresssing them aswell. I find my angels are quite aggressive to each other at times, if it has no other angels present it is possibly aiming its aggression at the rams.
Have the rams lost colour, can you see very dark bars down the length of the body, this is a sign of stress in rams, the darker it gets, the less likely the ram will survive.