I gave up and checked the analysis. There is only M4.
FIND MATE IN 3!!
There is mate in 3.
1. Rf4 Kxg3 2. 0-0 Kh3 3. R1f3 mate.
For some reason the engine doesn't think that castling is still legal.
There is mate in 3
and no castling is not legal
Rh8, Kxg3 forced. Rg8+, Kh2 Kd2, Kh3, Rh1#
Your counting skills need some improvement. That's mate in 4, not 3.
IF YOU FIND MATE IN 3, YOUR A GM.