Re: What went wrong while sailing downwind?
You've learned why dead-downwind is difficult, since you're constantly on the verge of a jibe if you get just a little too far "downwind" and too much by the lee.
I agree with the Laser comment above--I too prefer to keep the vang tighter downwind. easing it off allows the top of the main to get *too* loose, meaning there's too much twist and the top of the sail is so far out it's leveraging you to windward = 'death roll' once you get only slightly by the lee.
Easing the vang to depower the main works on a reach and above, but downwind makes the main a less stable force in terms of lateral stability.
Broad reaching and chicken-jibe will serve you well most of the time, save the sporty dead-runs til you're out of middle school.
That said, you "worked the problem", got in okay, asked the right questions, and learned from it.