NinjaBear, your first position is illegal because the rook couldn't have moved to the other side of the board.
Not according to MRO314, see post #3. It appears the king and queen can move to the c-file and back for the rook to escape (OR the king can castle).
NinjaBear, your first position is illegal because the rook couldn't have moved to the other side of the board.