I don’t think there’s any real world substances, since candles produce carbon dioxide, but at such a low level that it’s negligible, and torches don’t produce anything more noxious.
But you can have a great deal of fun having someone add something to the candle wax so when it melts, it gives off the gas that will render your adventurers unconscious. Or it could be a component of the oil that the torches are soaked in. You’d have to make it up, of course, unless you want to look at the sort of herbs or essential oils that are usually associated with bedtime. Off the top of my head, without any Googling, that could be lavender, chamomile, valerian…