There is a fungus called ergot (pronunciation varies), which mainly infects grains such as rye, wheat and barley. It produces alkaloids, which have various effects on humans. Some cause diarrhea and vomiting.
But of you can refine the alkaloids out of ergot... one of those alkaloids, called ergotamine, has a structure which is very similar to LSD. Lo and behold, it has also much the same effects. The visions from an acid trip should be quite disturbing for the average medieval person, due to their upbringing.
Medieval monks should be able to cultivate strains of ergot which produce more ergotamine than other alkaloids, thus being able to make drug bread. They could use this among themselves recreationally, and set some apart for torture. Simply feed a medieval peasant a loaf of ergotamine-laced bread and watch as they trip. When they sober up they will describe visions of hell.
Ergotamine can also cause gangrenes, necrosis and stillbirth, be mindful of those. Then again, you can't make an omelet without some gore, so...