I am sorry for your loss. I would consider something (below) for future fish acquisitions you may wish to do-
I am curious about this:
"I know the tank was fully cycled as I had tested it for several days prior to adding the fish and each time amon 0, nitrite 0, nitrate 40, PH 7.8. "
So the QT tank was running for several days with no fish, and the parameters measured were as above. Two issues: 1) 40ppm of nitrate is fairly high. 2) if the aquarium was cycled but ran several days with no fish, a substantial amount of bacteria may have starved and died, thus not being 'cycled' anymore.
There was no source of ammonia, thus, the bacteria may have starved. That could have been the reason for death of the gourami, and more so if it came in typically already weak shape (store-bought flame gourami). Did you add to the filter an amount of cycled media from an established tank just prior to adding the gourami? Again, something to consider for the future.