Perhaps they should have taught you to be less sure of that. So many takes in movies that ended up being the best one are where a punch accidentally did land, something is ad-libbed, a dialogue is mixed up, etc.
To take an example of a very critically acclaimed show: in Breaking Bad the only reason we got Jonathan Banks in the role of Mike is because Bob Odenkirk had a scheduling conflict, and Banks improvised a slap during his audition. Paul Aaron even complained about it indicating that he would not have agreed to it.
The lucky break is first a result of a lot of planning and work - and it gets analyzed to death before included - and then probably re-inforced here or there elsewhere. (So that for me, I do notice when I hear movie or TV dialog as completely natural and said exactly right. It's exceptional.)
Pixar's approach to making their movies is a fascinating highly iterative process going through many story boards and internal showings using simplistic graphics before proceeding to the final stage to produce a polished product. I wonder how Simpsons do it.
Not everything, for example I read somewhere that chess "fight" in Tween Peaks was random and didn't adhere to chess rules because no one really paid attention to record or follow moves.