We have learned that if a utensil absorbs a forbidden food by means of fire, it must be koshered by fire. It is important to note that this principle applies only when non-kosher food has been absorbed. For example, if one roasts non-kosher meat on a skewer, the skewer must be koshered through libun, because the non-kosher food was absorbed by means of fire. However, if at the time of absorption the meat was kosher, and only later became non-kosher, the utensil may be koshered through hagala. To use a classic example, if a korban (Temple offering) was roasted on a skewer, and the meat of the korban later becomes notar (the sacrificial meat left over when the time to eat the korban ends, which must be incinerated and not eaten), the taste absorbed by the skewer is also notar and thus forbidden. The skewer may not be used until it has been koshered, but it is not necessary to perform libun. Hagala is sufficient because the skewer absorbed the taste of the meat while it was still permitted for consumption.
Accordingly, if one mistakenly baked meat and then dairy (or vice versa) in the same tray, the status of the tray depends on whether twenty-four hours elapsed between the baking of meat and dairy. If less than twenty-four hours elapsed, the baked food is forbidden because the flavor of meat mixed with the dairy food. The tray also absorbed forbidden taste, and thus heavy libun is required to kosher it. But if twenty-four hours elapsed, the taste of the meat became foul, and thus the dairy food may be eaten. Moreover, although the Sages rule that the tray must be koshered, hagala is sufficient, because it did not absorb any forbidden taste. In practice, since people are accustomed to putting such trays in the oven, the best thing is to kosher it through light libun, i.e., by putting it in the oven at the highest temperature for half an hour, for we have already seen that light libun is more effective than hagala.
The leading Rishonim disagree about whether the absorption of ĥametz during the year is considered the absorption of permissible matter, in which case baking trays can be koshered for Pesaĥ by means of hagala, or the absorption of forbidden matter. According to most poskim and SA 551:4, ĥametz has the status of forbidden food even though it is completely permissible throughout the year, since vis-à-vis Pesaĥ ĥametz is always considered forbidden and even before Pesaĥ it bears the name “ĥametz.” According to this opinion, baking trays must be koshered via heavy libun. However, in extenuating circumstances and where there are other reasons to be lenient, the lenient position is occasionally relied upon (MB 451:28).