Keeping food warm: does cast iron make a suitable potluck vessel?
All the cast iron pans I've got came with instructions that read along the lines of "suitable for serving, but not storage of food".

I'm not sure what would suffer most though, your pan, or the food, or both, depending on length of time. My guess is that the length of time you actually can store food in a cast iron pan/pot safely somewhat depends on the ingredients used. For example, a tomato sauce would be less good to store in a cast iron pan than fried potatoes.

Regarding the temperature, I'd say it depends on how well insulated your "bag" is. Cast iron distributes temperature very nicely, but that doesn't necessarily mean it will cool less quickly than another type of pan (of same size/thickness) when taken off the heat.

Regarding keeping food warm, I did see insulated pots similar to a thermos flask you'd use for hot coffee or tea, which are made to store food. They have a big enough opening to be filled, and to be eaten from.