Note: when I say 'water deposit' I mean a man-made cistern to keep rainwater.
I asked a similar question a few years ago and a (now deleted) user posted a good response.
How about not castles but fortresses (purely military places with garrisons)? They should have had some places to keep prisoners including their own punished soldiers etc. I've seen such underground prisons/dungeons in medieval Western Ukrainian fortresses for example complete with torture chambers and equipment.