Template, beam, and possibly other spells will all instantly crash and close the game when targeted outside of the generated dungeon. This occurs to the top and bottom dungeon edges, but not to the left and right. It is trivial to reproduce via aiming Digging Ray too far southwards on any dungeon floor, or using eg. Thibault's Trompement at the top of a floor which has been dug out. Although this crash only effects particularly explorative heroes in the core game, it also renders wider templates in mods rather unstable.
Yeah, there was once a time when Bushido had a big cone-area attack Shout effect designed to alert a tonne of monsters in front of you, and it CTDed like 15% of casts for that reason.