Maybe a little obvious but was the mast properly rotated after coming onto port tack?
Or maybe jib sheeted too hard on port tack backwinding the main?
Phil