Castle defenders never boiled sand, but they did heat it
Sand can't boil until it's hotter than molten iron, yet the real story of what fell through a castle's murder holes is stranger and more practical than the legend.

Walk through the gatehouse of almost any big medieval castle, look up, and you may see them: square or round openings in the vaulted ceiling, staring down at the passage where attackers would have crowded. Tour guides call them murder holes, and the story usually told about them is vivid. Defenders poured boiling oil, boiling water or boiling sand on the men below.
Part of that story holds up. Part of it is a mix-up between physics and folklore. The real history of murder holes says a lot about how sieges actually worked, which was less like a movie and more like a grim exercise in logistics.