There is a great parallel to this in filmmaking. Some of the greatest films took unexpected turns during production, often forced to change in major ways due to accidents, scheduling conflicts, budget, or last-minute ad-libs which become central themes of their characters. In a number of films, those unplanned additions turned out to be key to the success of the film.
One specific example of this is The Other Side of the Wind, by Orson Welles, in which Welles noted the existence of this magic phenomenon and deliberately sought to make a film centrally driven by happenstance and unscripted ad-libs. In other words: trying to catch lightning in a bottle.