@Cheryl77177
The problem you experienced was not the fault of the Castoria, it was your response to it.
A dose of Castoria does take some time to work, sometimes as quickly as 6 hours, but can take up to 12 hours or even somewhat longer. When the Castoria starts to work, the person will start to get mild, widespread cramping. That is a warning you are going to HAVE to poo a lot fairly soon because the med has annoyed your entire bowel. You ignore this warning at your peril. The urge won't go away, but will soon get a lot stronger. That's why it works so well for diaper games.... the results are often soft, but not sloppy, and can't be resisted.
In your specific case, your mom should have asked you if the Castoria worked and made you poo. If not, you should not have gone to school. Once someone has had a full dose of Castoria they are going to poo, sooner or later and they won't be able to hold it for long once the urge starts.
An Afterthought: Since Senna, the active ingredient in Castoria, has to be metabolized in the gut to be converted into the laxative compounds, it is likely that Castoria is a more powerful laxative than the equivalent dose of Senna in pill form, like modern Ex-Lax. The liquid form is instantly distributed widely in the stomach. In fact, the last time I took Castoria, I was quite surprised at its poo power because my expectation was for a mild urge.