This is a Queen sacrifice to keep the game going on, but it makes Black give up Hermione. I commanded Stockfish to look for the 2nd best variation (hopefully one to not lose Hermione), and it still sacrifices Hermione (the Rook)

Stockfish only declares "Checkmate" if it is impossible to avoid, so that's the optimal moves. Not quite what the original Youtube Video said, so I guess the puzzle is a little bit flawed. Still, it seems like a "reasonable position" that satisfies all of the drama needed for the film.

Google's Deep Mind Alpha just obliterated Stockfish in a 100 game series, with Deep Mind winning 28, drawing 72 and losing none. Apparently Google gave its algorithm 4 hours of training time prior to the match.