I think the answer turns on whether we think that each firing weapon on a vehicle is treated like a separate firing unit or not. Attend:
You're quite right that no rule states what to do if the number of models in the target unit the template can hit is zero. You're also quite right to observe that page 52 says, "Any models fully or partially under the template are hit," not "any models in the target unit," so if the template could be fired in your example, it could hit the gaunts.
Here are what I believe are the two rules that control this scenario:
Page 12 states, "Any model that is found to be out of range of all visible enemy models in the target unit doesn't shoot - his shots would not be not accurate enough to hit anything."
Page 72 states, "When firing a vehicle's weapons, point them at the target and then trace line of sight from each weapon's rnounting and along its barrel to see if the shot is blocked by terrain or models. If the target unit is in cover from only some of the vehicle's weapons, then work out the target's cover saves exactly as if each firing weapon on the vehicle was a separate firing unit."
So we can see, if the flamer couldn't see the carnifex (even if, somehow, it could see the gaunts), it wouldn't fire at all, and the gaunts would not get toasted. Here is the question: do we work out range as if each firing weapon on the vehicle was a separate firing unit, or line of sight only?
If the former, then the flamer does not fire (because the flamer "unit" is out of range, even though it has line of sight), and the gaunts are not toasted.
If the latter, then the flamer does fire (because the dreadnought unit is in range, and the flamer "unit" has line of sight), and the gaunts are toasted.
I think most people would go with treating each firing weapon like a separate unit for line of sight and range purposes (though not for targeting purposes, obviously). I can certainly see the argument for treating each firing weapon like a separate unit for line of sight purposes only, though.