Yeah, this is called the horizon effect: if I take your knight with my queen and stop calculating I’m up a knight, when in reality the queen will be taken on the next turn.
One chess engine I saw long ago used a small depth (maybe even 1!) but with the exception of consecutive captures to avoid the biggest case for this issue (pawn promotion as well iirc)
One chess engine I saw long ago used a small depth (maybe even 1!) but with the exception of consecutive captures to avoid the biggest case for this issue (pawn promotion as well iirc)