Epoxy bonds considerably better to cured polyester than polyester resin does, and it is osmosis-resistant too. But you cannot apply gelcoat over epoxy; it has to be painted. If you want a gelcoat finish, polyester is the obvious choice. So your top coat decides the resin, not the other way round.
Why epoxy bonds better
Polyester resin bonds chemically to polyester as long as that has not fully cured. On a hull of ten or twenty years old that chemical bond is gone; then it is purely mechanical, and that is considerably weaker.
Epoxy does bond both mechanically and chemically to almost any substrate, including old, fully cured laminate. For structural repair on an older boat that is the stronger starting point.
The catch is in the finish
Gelcoat is itself a polyester resin. Over epoxy, gelcoat cures poorly or not at all: it stays tacky or lets go later. So an epoxy repair is finished with paint, not with gelcoat.
For an underwater hull that is rarely a drawback, because primer and antifouling go over it anyway. Above the waterline, where you want the colour and shine of the hull back, it changes the whole job: repairing one scratch with epoxy ends up meaning painting a whole panel.
That is why above the waterline we generally work with polyester and gelcoat, and below it with epoxy.
Cost and handling
Polyester resin is cheaper and cures faster, which is convenient when several layers have to go on top of each other. Epoxy is more expensive, cures more slowly and is more sensitive to the mixing ratio: estimate too generously and it stays soft.
Epoxy smells less than polyester, but it does call for gloves, because skin contact can cause sensitisation - after which you can never work with it again.
In short
Below the waterline, structural repair, or a boat older than fifteen years: epoxy. Above the waterline with a gelcoat finish: polyester. And in both cases the preparation - the tapering - decides more about whether the repair holds than the choice between these two resins.

