I looked up tinned raspberries, and three brands had the raspberries canned in grape juice.
It might be that, even if well-drained, the raspberries used would have still retained some grape juice, and that may have been enough to curdle the milk, especially while it was all heating up in the oven.
It might be better in future to do what was suggested earlier, and stir in some fresh raspberries at the end, or better still, some raspberry coulis with a few fresh ones.