Chess is not a fully "solved" game, so the actual perfect move is not generally known. Like any other engine, Stockfish just tries its best and is not infallible.
Technically, the tablebases for 7-piece chess are fully solved, and since we are talking about games starting from partial board states, you could trivially compare both engines to the "perfect" move for a huge number of board states.
That’s not the right answer. The real answer is it was playing against a stockfish at a low difficulty setting.