"The toilets of a castle were usually built into the walls so that they projected out on corbels and any waste fell below and into the castle moat. Even better, waste went directly into a river as is the case of the latrines of one of the large stone halls at Chepstow Castle in Wales, built from the 11th century AD.
Mediaeval castle latrine
Some castles, such as the 11th-century AD Corfe Castle in Dorset, England had latrine shafts emptying directly in the courtyard or bailey while still others hung conveniently over a cliff face, as at Peveril Castle in Derbyshire, England, built in 1176-1777 AD.
The protruding shaft of masonry that made up the toilet was buttressed from below or might nestle in the junction between a tower and wall. Some waste shafts were short while others reached almost to the ground. In the latter case, that might prove a dangerous design feature if there were a siege of the castle. Indeed, besiegers used just such a latrine shaft in 1203-4 AD to gain entry to Chateau Gaillard on the River Seine in France, built by Richard 1 (r. 1189-99 AD) at the end of the 12th century AD. After the siege, to ensure no repeat of the trick, a masonry wall was built around the shaft exit.
Garderobe, Peveril castle
Another design was to have tiers of toilets on the outside wall where the shafts all sent waste to the same collection point. Dover Castle, built in the second half of the 11th century AD, had a cesspit at the base of one wall of the keep to collect waste from the toilets above. At Coity Castle in Wales, built in the 12th century AD, there were three tiers of toilets with the shafts emptying into the same courtyard basement. The same arrangement was found at Langley Castle in Northumberland, England, built c. 1350 AD, with the common collection point being a pit which was cleaned out by a natural stream. There were also toilets in ground floor buildings and these had stone drainage channels to drain away waste. Waste from such collection points, or the ditch in general, was likely collected by local farmers to be reused as fertiliser.
Toilet, Tower of London
When castles became larger and more comfortable from the 14th century AD, so the number of conveniences increased. Bodiam Castle in East Sussex, England, for example, had no fewer than 28 toilets emptying out into its moat."
https://www.worldhistory.org/article/1239/toilets-in-a-medieval-castle/
maximus otter