A Puzzle which can't be Solved by an Engine

I decided to make my own version of this puzzle. But, it’s not very easy to make a puzzle like this one.

First I set up this position:

The white rook is the piece that’s going to checkmate. It’s important that the white king is on d5 so that black’s previous move couldn't have been e6-e5, because then white would not be not allowed to take en passant.

Then I added some pieces to enclose the black king:

I've also added a knight on f4 in order to make a mate in 2 puzzle. But, the position still isn’t correct.

In the diagram below I've added a rook on g8, because otherwise black can play 1. fxe6 e.p. g6!, now black can play g6 but the black king can't escape.

I've also added a pawn on g3, h3 and c5, those pawns are very important because otherwise black’s previous move could also be Ke7-f6 or Kg5-f6:

Now my puzzle is correct, this is the result:

Puzzle 2, white to move checkmates in 2:

Solutions of the puzzles:

Puzzle 1:

1. hxg6 e.p.! If you see this position, black’s previous move must have been g7-g5, that’s the nice thing about this puzzle, that’s why I didn’t make a puzzle diagram. 1… hxg6 2. kxg6 cxd6 3. f7 Black can’t prevent promotion.