Just a quick, non-hostile technical nitpick: I don't believe that at any point, energy will actually be flowing back into the drink. If the drink is cooler, the insulator layer will become a significantly worse conductor, preventing heat from flowing outward as well as from the liquid-phase insulator, but thermodynamics/the law of entropy shouldn't really allow for the energy to flow back into the liquid, even when the insulator does re-solidify.
If you rapidly cool the drink, you're definitely right - energy would flow PCM -> drink. Otherwise, it's semantic if GP is correct. There would be dynamic equilibrium, i.e. flow of thermal energy in both directions, but no true flow from PCM->drink.
3a) drink cools to 140-epsilon before PCM liquifies fully
4a) PCM gives energy to drink in dynamic equilibrium, while also losing energy to environment, solidifying
5a) PCM is entirely solid at 140
6a) PCM drops below 140. drink gives energy to PCM and PCM to environment. drink -> PCM thermal conductivity is presumably much higher than PCM -> env, so drink and PCM remain at same temp
OR
3b) PCM liquifies fully before drink hits 140-epsilon
4b) drink and PCM stay at thermal equilibrium (see 6a) while cooling toward 140. energy flows drink -> PCM and PCM -> environment. The former is faster, so the PCM continues liquifying
5b) PCM is entirely liquid at 140. Due to thermal equilibrium, drink is also at 140.
You seem to assume that the PCM encapsulates the drink on all sides. But the cup has a lid, which doesn't have a PCM inside, and which isn't perfectly isolated.
So there will be energy going from the drink to the environment through the lid, which in turn allows energy to flow back from PCM -> drink.
When the "insulator layer" (a phase change material or PCM) is between phases, it can absorb or emit energy without changing temperature.
The drink on the other hand will change temperature as it looses energy.
The drink will lose energy through the lid, leading to a small temperature gradient between the PCM and the drink. This gradient should allow energy to flow back from the PCM into the drink.
Its „Temperfect insulation“ is most likely a PCM i.e. a phase changing material storing heat in a phase transition. It absorbs or releases heat depending on the outer temperature by means of a physical phase transition (not sure if this is really liquid-solid but perhaps a crystal reconfiguration).