The link to the preset:
http://play.chessvariants.org/pbm/play.php?game%3DWildebeest+Chess%26settings%3DWildebeest+Chess+with+rules
The error occurs in the procedure 'checkkcastl' in the pre-game part.
Near the end there is a do-until loop that checks if the king crosses
attacked squares. This loop seems to cause the error.
The error occurs when legally castling with the king over 2 or more
squares (entered as a king's move, e.g. f1-h1). Then the said loop is not
ended by the 'die' command but by the until-condition, and the error
message is produced.
If I castle over an attacked square, the 'die' ends the loop, and it
works correctly.