If he's had some constipation, but now is having a regular BM, he could have small anal tears caused by the harder stools and it would still hurt as he's passing even the regular stuff.
Also, the bowel muscles could be cramped, just like any other muscle, so it might take a few days of regular stool to feel normal again.
Our son did the same thing when we started solids, and it kept up until he was a toddler. Literally screaming to pass a BM that didn't really look all that problematic. It became a less frequent problem after he was 16 months or so. Now, at 27 months, we haven't had a problem with it in a long, long time.
We did learn to avoid bananas and cheese though. One nibble of either would stop BMs for days and days. And we added 3 or 4 ounces of straight apple juice to his diet daily, which seemed to help a lot.