I was playing on an Android app and the computer player dropped a Rook next to my King like this (there were other pieces on the board, but they are not relevant):
It was then my turn, and the square I mark here with green was offered as one of the spots where I could safely move my King:
I thought this was strange, since after my move the Rook would be a promoted Rook and it would have access to the green spot. So I moved there to see what would happen:
Faced with the King in an adjacent square, the promoted Rook just moved away:
This was extra strange, because the promoted Rook was actually protected by other pieces and had no reason to move away. In other words, the King could not turn around and kill the promoted Rook because it would put itself in check.
What was that all about? Why was I even allowed to move to the green spot?