Do not apply that rule indiscriminately. The food's type, storage history and applicable instructions determine whether it remains suitable to cook or freeze.
What the observation tells you
Cooking is not a universal rescue for food that has been mishandled or kept too warm for an unsafe period. A package may also contain food already cooked or previously thawed. Without that information, a blanket instruction can be misleading.
A useful next step
Use current official guidance and the product label, and keep raw and ready-to-eat items identifiable. If safety is uncertain, seek appropriate advice rather than refreezing merely to avoid waste.
Manuals and supporting guidance
Model-specific instructions take priority. These references support the practical principles discussed here; they do not diagnose your appliance.