There are several things that could have happened.
For example:
- Was Roost used the previous turn?
- Was Roost used after Earthquake (same turn)?
In both cases, Earthquake will not hit, as the flying typing was gained or not lost when it was used.
Option 2 is a very likely one, as Skarmory is pretty darn slow. Which means that it will almost always move after Mamoswine.
Hope I helped!