Did the AI attack you with a stack outside of Massilia and the Massilia garrison came to the field as reinfocements? Did you completely reduce the garrison army?

There seems to be a bug with reinforced battles, especially when a city is captured due to a complete rout of the garrison army, but I´ve never experienced that in a vanilla Imperial campaign, but very often in Provincial campaigns which mods use.

An additional note: The unit size you´re playing on may have an influence on the occurence of this bug as well. On Huge unit size I had way more ctds than on large size.