Could white have just played Bg4 from somewhere without capture? Black’s prior move was Ke5-e6. This can be fixed by a shifting wNg3 to e3 and wBd4 to g3 in its place. This stops other cooks where White has just given a discovered check. Adding a further wN on c6 also prevents any retractions with the White rook, and the Black king moving to e5.
[FEN "8/3R2Kp/4kP1P/3R3P/6BP/4N1BP/P1P4P/8 w - - 0 1"]
A key point is that retracting 1. e5xf6e.p. f7-f5 2. B~g4+ Kf5-e6 3. N~e3+ works, as wPe5 blocks wRd5 from attacking f5, and so bK on f5 only endures a single check (from wNe3).
General chess problem solving engines e.g. Popeye don’t currently offer retraction capabilities. It might be possible to solve Edith Baird style retractors though, but not ones with retro logic.
The database pdb.dieschwalbe.de contains lots of retractor problems. Type k='help retractor' in the search box, and hit Overview to begin your journey in this amazing resource.
Addendum #1 11/30/2020: Here is a sound version by Rewan, a correction of my above "correction"! It is certified correct by Mario Richter's Rawbats program. The above version is incorrect due to 1. Rf5-d5 being a possible last move for White as well, and, furthermore, multiple stalemating moves afterward.
[FEN "8/3R2Kp/2N1kP1P/3R3P/3B2BP/6NP/P1P4P/8 w - - 0 1"]
Addendum #2 11/30/2020: I found a bug with my earlier proposed version, and also a way to make this much more economical. The new solution is proved correct (aka "C+") by Mario Richter's legendary Rawbats program.
[FEN "8/3R2K1/4kP1P/3R3P/3P2BP/4N1BP/7P/8 w - - 0 1"]
White has made 15 pawn captures, so if the last move (which must have delivered check) was by an officer, then it was not a capture, so Black has no prior move, and the position is illegal. The only possible last move is en passant, R: 1. e5xf6ep# so we conclude that this definitely was the case.
(For retractors, one does not need to prove that the prior move was definitely a double hop in order to allow the en passant retraction. In this case, the logic goes the other way round: the en passant proves the double hop.)
Now the retraction goes R: 1. ... f7-f5 2. B~-g4+ Kf5-e6/Ke7-f6 3. S~e3+/R~-d7+ etc.
Instead of the first retraction, White can play 1. Se3-f5= for stalemate.
(It could be possible to generate this effect in a position in which White is not delivering check, or in which one can retract uniquely further.)