Combination of of temperature, nitrates and general pollution (if 25ppm was a normal and regular level I mean). In my limited experience Rams are sensitive to everything. The gH seems fine, though I expect Rams like it even lower where possible. pH seems a little high; maybe the water company are adding kH to buffer the water? I do not know if soft water fish are harmed by high kH or just gH. My Ram seemed to die from a tummy bug after engorging on a dead shrimp, but I was foolishly trying to do a medium heat water to suit both the Ram and the Cories, otherwise he may have fought off the illness.
I read somewhere ages ago (magazine or even this forum I expect) that our hobby isn't fishkeeping it's water keeping. Fish that people have found to tolerate a wider variety of conditions probably do so because that's what they have evolved for. Years ago Rams used to be labelled in all the handbooks as "expert" because they seem to be one of the species that do not seem to tolerate any of the minor mistakes we all make occasionally, especially when new.
The death of the gourami at the same time is more concerning. What do you mean by "fine" parameters? And how often do you check them? If you are overstocked, maybe the tiny amounts of ammonia that appear before they "dealt with" are proving to be slightly too toxic for the fish due to the slightly alkaline pH.
Test your water, monitor the health of the fish. It's possible your tank is mature and the water is indeed fine, at least for the remaining fish; the pearl gourami death might just be an unlucky co-incidence. But it would be best to check now when you have the chance to at least do some extra water changes if you think you need to before there are more deaths.