According to the FIDE Laws of Chess:
4.4 If a player having the move:
4.4.1 touches his king and a rook he must castle on that side if it is legal to do so
4.4.2 deliberately touches a rook and then his king he is not allowed to castle on that side on that move and the situation shall be governed by Article 4.3.1
Yesterday in the semi-finals of the Chess960 World Championships in the following position Nepomniatchi tried to castle kingside by first picking up his rook to move it off the king's destination square (g1) to f1, the rook's destination square and then moving the king to g1.
The arbiter ruled in accordance with 4.4.2 that he was not allowed to castle kingside and the king must stay on e1 and he got a bad position. Later, after an appeal, this was overruled and they replayed the game.
[title "Neponiatchi - So, 2019 Chess960 1/2 final"]
[fen "2nr1r1k/pb1n1pqp/1p2p1p1/1N1pN3/5P2/1P4P1/P2PPQ1P/2R1K1RB w - - 0 1"]
Jonathan Tisdall, on Twitter, reported that:
According to organizer Jøran Aulin-Jansson, the rook being on g1, the king destination, caused enough confusion to overturn the strict ruling
This raises the question: In such situations how can the player legally castle on the side where the rook starts on the king's destination square?
One humorous, though impractical at short time limits, solution was suggested here.
Even more impractical was MrDodgy's suggestion:
A true pro would pick up the rook from g1, toss it up in the air, slide the king to g1 and the rook would land dead centre of f1. Press the clock, lean back in chair. Flex.
Still illegal.