yes, but the question isn't if a computer will play correctly given the position, it's "will the computer force this position as white, if it's the best move?" which relies on it's evaluation of the position.
But yes, given a chance to get into this position, sure it will - e.g. given https://en.lichess.org/analysis/8/p7/kpP5/qrp1b3/rpP2b2/p5b1..., it will correctly play b3 and force the original position, since everything else results in a mate that it can see. All it needs for correct play is to rank the alternatives in the right order, and mate ranks below playing on with a material disadvantage.
here's a preceding position which stockfish completely fails to play correctly.
how I play the position as black is Ne7 followed by Bd6. if white plays Qh4, I can play nd4+ followed by nf5 and nd6, and my king is safe. and I can slowly, safely, extricate myself and win.