In Shulchan Aruch Yore dea 105 there is Machlokes Haposkim on this whether if one puts kosher liquid with food for 24 hours (kovush) in a vessel that has just had non kosher liquid Kovush inside that vessel after emptying out the contents. (if the kosher food is dry there is no transferal of taste from a non kosher vessel unless it is very spicy/sharp like with a Beis Seor vecharoses see SA OC 451):
This is the Beer Haitev on seif alef :
באו"ה כ' דאם נשתהה הבשר בשרייתו מע"ל אף הכלי אסור בדיעבד וצריך ס' נגד כל הכלי אם הוא של עץ או חרס דקי"ל כבוש כמבושל אפילו בכלים ולא דמי לחבית דיין נסך דשרי לשום בו שכר לכתחלה דביי"נ הקילו אמנם בשל מתכות אין מצריכין ס' נגדו בדיעבד כי אם שנאסר ע"י רותחין וכן בהיתר ששרוי בכלי של איסור ב"י וכן איסור ששרה בכלי של היתר מע"ל שאסור הכלי עכ"ל והט"ז כתב ע"ז וזה לשונו ולא אוכל להבין למה יאסר ההיתר בכלי של איסור בן יומו דהרי האיסור מחמת כבוש הוא אחר שיעור כבישה שהיא מע"ל דאז נעשה מבושל והרי באותה שעה אינו בן יומו וכו' והגאון המחבר מ"א שמע בשם מורינו רב יעקב מלובלין בשלמא אם הכלי עומד ריקן נפגם הטעם אבל כאן שעומד בו היתר תדיר א"כ כבר התחיל לקבל טעם בשבחו ולאחר מעל"ע נעשה כמבושל ממש ולכן אסור. וכ"כ בה"י סי' ס"ט וריש סימן זה ע"ש דלא כאחרונים שכתבו להקל בזה ועי' פר"ח שחולק ג"כ על ט"ז. ולפי הנראה דאין לאסור בדיעבד מה שנשרה היתר בכלי של איסור מע"ל (ובט"ז יש כאן ט"ס ע"ש) אלא לכתחילה כדין נטל"פ גם מ"ש האו"ה לחלק בין כלי עץ וחרס למתכות לא מצינו חילוק זה בשום מקום אלא העיקר בזה דבכל הכלים אין לאסור אותם בדיעבד כנ"ל. והש"ך כתב שמצא בכת"י הרב בגליון או"ה שהרגיש בזה הקושיא וכ' שמיירי שהאיסור קצת בעין ולישנא דבן יומו לא משמע הכי ועוד דהא בכלל ל' כתב קערה מודחת וצ"ע.
Basically it is machlokes.
-The Taz (seif 1) and Shach (seif 2 near the end) who both hold that a cli (vessel) that had Issur (non kosher) for 24 hours can no longer cause kosher food to be ossur (prohibited), as by the time 24 hours of the kosher food waiting to receive flavour from the pot passes, the flavour is Nosein taam liphgam (unfit taste) so the kosher food remains permitted.
-However Rav Yaackov Milublin holds that since the kli is filled with liquid, it can't become pogum unless it is empty for 24 hours, so as long as the kosher liquid is inserted before 24 hours has passed from the non kosher liquid, the kosher liquid becomes ossur after 24 hours.
-The Pri chodosh says that kovush happens just before 24 hours therefore f the non kosher lquid in the cli is directly replaced the kosher liquid becomes ossur just before the non kosher flavour inside the walls of the cli becomes pagum (un fit) therefore the kosher liquid if straight away replacing the ossur liquid that was emptied.
The Beer Haitev concludes that everyone agrees that Lechatchila one should not place kosher liquid or wet solids in a non kosher kli just like one shouldn't use treif pots that have not been used to cook with for after 24 hours from previous usage.
A bag will not make a hephsek (barrier) between the the juice on the outside and inside as the taste transfers straight through the bag as it is less than a klipa (peel) thick container when Kovush. This is evident in the Taz seif alef: הרשב״א בתה״ה דהחבית שנאסרה ע״י בלע יין עובד כוכביס בצונן אינו אלא מועט וע״כ סגי ליה בקליפת הכלי להכשיר וכ״כ הטור סימן קלה ומשס יליף הרשב״א לדיניס אחריס כגון חלב ודס לענין איסור מועט בכלי גדול כמו שנזכר שס. (accoring to some rishonim the taste even transfers through a thick wall but the Taz chooses not to follow that opinion and relies on the Tur and Rashba).
Conclusion Don't try this at home, but if you left kosher food in a bag in pot that was used for 24 hours with non kosher liquid, which was replaced straight away with kosher liquid and left for 24 hours ask a rabbi if you can rely on the Shach and Taz to permit the dish and he'll decide.