Label the squares in the grid (0,0) to (2022,2022). Consider the position of the gap after a domino is moved. Note that the parity of the coordinates of the square containing the gap will not change. Also, the same square cannot contain the gap twice, otherwise this implies that a domino was moved into that square, and was moved out of the square again later, which is disallowed.
Considering coordinates modulo 2, in the 2023×2023 grid, there are 10122 squares labelled (0,0), 1012×1011 squares labelled (0,1) or (1,0), and 10112 squares labelled (1,1). Hence, the number of moves is at most 10122−1, if all the (0,0) squares are the 'gap square' at some point.
This is attainable by connecting these squares in a 'snake' pattern, and sliding dominoes accordingly; the remaining 1×2022 rectangles can be also tiled with dominoes that do not move throughout.
