Oh, I was thinking board positions that could never be reached in a real game. Actually, I have no idea what the technical definition of a legal board state is, haha.
Well, there are chess problems that are specifically composed so that a solver can work out the right moves to achieve checkmate. For a lot of these composed chess positions, it’s virtually impossible for to get them in a real game but that’s not the point. Engines can analyze these but they can get tripped up depending on how the problem was designed.[1] The legality of the board state seems like a different concept. An engine can’t be used to analyze a position of where the Black king is in check and it is White’s turn to move. It doesn’t matter if you got to that board state by composing it or by making a sequence of previously legal moves.
[1]: https://chess.stackexchange.com/questions/23837/solvable-stu...