mate in 22 move

The first puzzle is referenced as a mate in 24. I couldn't find a engine solution at M22.
The puzzle is from Horatio Bolton, The Chess Player's Chronicle, 1850
kbb3q1/5p1r/pp1N2nP/2P1N3/1P6/Q6P/6pK/8 w - -

wat point of all the queen checks
The queen needs to keep checking the king and getting closer to the king.

The reason white does all the checks is to remove the g2 pawn with check.
Than stair step it’s way back closer to the King.
White can’t do forced checkmate with the g2 pawn still on board.
Look at the position on move 6 & 20.
The position looks identical, but their is only 1 difference.
The G Pawn - Ask yourself the question:
Why can’t white take bishop on move 7. Qxc8
On move 20. Qxc8 is brilliant move, but why not on move 7?
*Hint* G Pawn is clue