In Thor: Ragnarok Skurge has taken over Heimdall's position and from what it seems like, Loki has specially appointed him so he announces Thor's arrival. Has Loki forcefully removed Heimdall from his rank or had Heimdall known the prophecy of Ragnarok beforehand and thus quit so he could save the people of Asgard behind the scenes?
In the movie, Skurge tells Thor that Heimdall has been removed by Loki because of his lack of discipline. Loki has to create some reason in order to remove Heimdall from his position as he was trustworthy to the Kingdom. I think Thor is the only one who knew about the prophecy as he was following the infinity stones.
Heimdall managed to help the people at the right time because he can see the entire universe (and different paths in the Kingdom) with his eyes not because he knew about the prophecy.