I'm probably wrong, but from what I remember it wasn't night yet. The sun was only coming down. Once again, I'm probably wrong. (This is probably what actually happened: The sun was probably coming down before the time he was carrying the sunflower.)
Sunflower do not close at night. They are called sunflower because they "look like" the sun. I was raised in Kansas, where it's the state flower, and my grandmother grew them.
To clear up:
Sunflowers focus their heads directly at the sun during the day and at night all their heads are focused at where the sun last shone. Only their heads move, and the flowers cannot, and have no reason to move their petals. The only reason they have petals is that when the seeds are not yet fertalized by insects, the petals act as a visual atractant to insects that will see that it is a flower. After the pollen is moved around all the different prematured seeds, the seeds fetalize and become edible. The seeds also need to be focused at the sun to draw energy, and so the plant gets sun itself.
ok, this is just me being a weirdo and using my love for violence and has really nothing to contribute, but what if when Shrek ripped it out of the ground, it opened its petals to scream in pain, but died before it could, thus leaving its petals open. I have 2 words for myself. Overactive Imaginiation.