It doesn't matter whether the computer makes the best move or not, as long as your move is the best and leads to an advantage after any reply.
If white's first move means black's best is to sacrifice his queen, then the problem works.
If the tactic requires a bad move for it to work, then the problem is broken.
I just ran into an unexpected result in Problem #0036566 when I ran my own analysis on the board after reading questions in the comments. According to the problem flow and analysis, black made the strongest move out of three that avoid checkmate. However, it's unclear which move is strongest for black until a deeper search, at which point it becomes the weakest at an advantage for white of over +21. The originally considered weakest move that sacrifices black's queen becomes the strongest by at least 12 score.