Rendering audio quirk

Yesterday I rendered out a 1 hour show using the YouTube preset. The final render was great with no audio issues at all. I then had to go in and change an aspect ratio and then rendered the footage again, using the exact same settings. This time the audio was off my almost 1/2 second. I immediately re-rendered the footage, again using the same YouTube settings and this time the audio was matched perfectly.
In the end I had my final output but I have to be honest and was very concerned about the audio sync issue as I had no idea why it happened, or how to prevent it from happening again.
In the end I had my final output but I have to be honest and was very concerned about the audio sync issue as I had no idea why it happened, or how to prevent it from happening again.