"This" (or "that") is used for emphasising, often when something new is going to be said. In your text you added a new bit of information (why it happened), so "this" is better.
For example:
Yesterday I had to walk to work in the rain. It made me soaking wet. ["it" is referring back to "the rain"]
Yesterday I had to walk to work in the rain. This is why I arrived soaking wet. [emphasising the rain]
So in your text, using "it" would be better if you said something about the bus:
I missed the bus. It left before I got to the bus stop.
[but better to join with "because" because the first sentence is so short]