Roost only causes the Pokémon to lose its Flying Type for only 1 turn
So, for example:
Turn 1: You used Draco Meteor
Opponent uses Roost.
Turn 2: You used Earthquake
It’s already Turn 2, not Turn 1, and Roost only caused them to lose their Flying Type in Turn 1, hence they were immune.