In an ideal world, the creative team behind a film would get to execute the precise vision they had back in the project's earliest days, way before they even put pen to paper and the finished movie was but a distant glimmer.
But, this rarely happens. As is the case with any group project, visions collide, schedules don't line up, tensions rise, and things can easily change. While the bulk of these alterations will ideally take place before shooting has started, some movies are unfortunate enough - or fortunate enough, depending on the final outcome - to undergo major shifts in tone, story, or structure, while the cameras are actually rolling.
Obviously this isn't ideal, but because of how complex filmmaking can be, it's always a possible scenario. On the plus side, as fans, it's interesting to observe how different productions handle the pressure of being faced with a massive problem, at the least opportune of moments.
Some add extra scenes, others re-do the whole thing, and some aim for a change in tone, but either way, the movie ends up being a lot different from that initial vision.