I think the composer missed the ressource ...Rf7.
Black can and should castle no matter what, which forces white to use his queen to deliver the final blow (otherwise he needs 2 pieces to covers g8 and h8, and it is much slower).
To help the queen mating, the most accurate first move is 1.Nf5 (or Qe2)
If Black moves his king other than O-O, then b7 b8(=R) is mate in 2 (3 overall). If Black does not move his King, he loses to Qe2+ followed by b7 b8(=R) (mate in 4 overall).
After Black castles, 1...O-O 2. Qe2 anyway.
And it seems Black cannot stop mate in 2 via Qe7, Qxg7# which would give mate in 4 overall.
But black can actually play Rf7 right away or after Qe7. For example :
1.Nf5 O-O 2.Qe2 Rf7 3.Qe8+ Rf8 4.Ne7+ Kh8 5.Qxf8#
So mate in 5 with correct defense from black.
what if, the 'wrong' is in composers part? he didn't analysed all type of history lines.
its not a complete solution if you exclude one type of history line.
But in this case the composer clearly did analyze all the histories, since in order for the solution to be complete, he had to confirm that either side could castle but not both in the starting position.