It's a striking warning: "if we or an angel from heaven should preach a gospel other than the one we preached to you, let them be under God's curse" (Galatians 1:8). Paul doesn't mince his words and we can be glad he didn't - the gospel is far too important to mess with. But why extend the warning to include 'an angel from heaven'? Is this just stylistic hyperbole?
Maybe Paul has in the back of his mind the unusual episode in 1 Kings 13 where a man of God from Judah is sent by the Lord to speak God's judgement on Jeroboam and was then to return home pronto, no staying to feast with the king. The message was to be spoken to the altar Jeroboam had fashioned, thus corrupting Israel's worship; it heralded the reign of a Davidic ruler who would be raised up by the Lord (Josiah) and would restore true worship and judge the corrupt.
The man of God played his part well and set off for home, just as he had been told to do. But a certain old prophet ran after him and urged him to return for the sake of hospitality - and he swayed the man of God with these words: "An angel said to me...bring him back". The man of God allowed himself to be persuaded and fell into judgement.
A message about a Davidic king who restores true worship and judges its corruption? The need to hold steadfastly to what God has spoken, even at the cost of the approval of other people? Maybe Paul wasn't being so random after all.