I'm going to say it isn't the carrot- could just be a fluke. When Layla has diarrhea I give her plain canned pumpkin- fixes it quite fast.
In the future I would only give real carrots- not the baby ones. I read in a health magazine that they may have cholrine in them- hard to say if that is true but I'd rather be safe than sorry