Some parts have audio out of sync after a master export I have a project in Final Cut Pro X, that plays as I expect in the Final Cut, but when I export in to h264 there is a part where audio is playing slightly in before the video.
Such part is present on the following screenshot:

At the beginning the audio is in sync. Then there is a 100x speedup, and then audio get's out of sync (I'm talking about the clips audio, not the green music). Ironically there is also a connected clip that appears slightly later, and it also has a 100x speed increase later on but that does not cause any problems. Also both clips' audio plays separately in the left and right channels, so in headphones I can hear that in FCPX some audio bits happen at the same time, while in the exported file they are out of sync…
Am I doing something wrong?
I don’t think you doing something wrong.
My suggestion is copy the sequence to a complete new and fresh library. This should load the clips again and hopefully get rid off any possible problems in the library.