When your own king is in check and your move removes the check and at the same time delivers check to the opponent king then the game.kingIsChecked variable is wrong, it is false but should be true.
I stumbled upon the error with the following position FEN:
2K1r3/3P1k2/8/8/8/8/8/2R5 w - - 0 1
where White is in check already.
After the promotion move dxe8Q+ the black king is in check but kingIsChecked is false.
After the promotion move d8N+ the black king is also in check but kingIsChecked is false.
The error has nothing to do with the promotion, I tried it with different positions and the common condition for the error is that the own king is in check directly before you put the enemy king in check.
When your own king is in check and your move removes the check and at the same time delivers check to the opponent king then the game.kingIsChecked variable is wrong, it is false but should be true.
I stumbled upon the error with the following position FEN: 2K1r3/3P1k2/8/8/8/8/8/2R5 w - - 0 1 where White is in check already. After the promotion move dxe8Q+ the black king is in check but kingIsChecked is false. After the promotion move d8N+ the black king is also in check but kingIsChecked is false.
The error has nothing to do with the promotion, I tried it with different positions and the common condition for the error is that the own king is in check directly before you put the enemy king in check.