@Remellion suggested in a comment, less than an hour ago, for a directmate joke problem in which the key is to capture a ghost rook in order to prevent ghost castling as a defence.
As such, I decided to try to make such a problem just for fun. This is what I came up with.
[Title "Black To Play And Mate In Four Moves, White Odds Of No Ra1"]
[FEN "r6B/4p3/8/8/8/3p1k1p/3P4/4K3 b - - 0 1"]
1. Ra1+! Bxa1 2. h2 Bd4 3. h1=Q+ Bg1 4. Qxg1#
EDIT: Many thanks to @Remellion for pointing out a flaw in my original diagram!
If Black attempts to push their pawn first, White can simply ghost castle and prevent checkmate in the specified length, although they are still losing either which way. Thus, Black must capture the ghost rook, and ONLY then may they push their pawn.
Now, White can't ghost castle to escape. They try to delay their life but it is futile. They are soon checkmated by a promoted Black queen or rook.
I do like how this idea can achieved with such economy of a mere total of just 8 pieces, and how it can be extended to a four-mover.
Also, I suppose the way these "ghost" rooks work is that they ARE OTB technically, but they are invisible, can be moved through, and they can't interact, i.e. moving or attacking, with everyone else, all like a real ghost. But other pieces can chose to not interact with it by sitting on the square, or a one-time capture of the ghost rook is announced.
The technicality here is that since the rook is still there, and that castling counts as like king move, the ghost rook can be moved without ever technically moving on it's own. As such, interesting problems, such as mine, can arise.
An interesting concept that arises from this definition of a ghost rook is that a piece can capture two enemy pieces on the same square. If White's a8 rook moves to a1, a Black piece can actually do a "double-capture" on a1, and take both rooks at the same time.
While these rulesets can be applied to any "ghosted" piece, minus the king of course, the rook is the only interesting case due the castling possiblties that there are to explore.
WARNING: Some irrelevant rambling follows!
Another rule that could possibly be added, to heighten possible problem curiousites, is a rule bend where Kings cannot move onto where sqaures where a ghost piece would be attacking if it were actually in play. Since Kings cannot be in check, they can't be played there.
Then this leads me to think of a chess variant where there is a whole sub-field on the chess board where there is normal play along with ghost play going on at the same on the same board, but neither field can interact with the other, except for Kings not being able to move into an opposite checking field. It can't be checkmated, but it can be paralysed. Stalemate with no visible pieces is an interesting idea.
I should probably get to work on this "Ghost Chess" idea. Unless it has been done before. I wouldn't know!