Hi everyone, this usually happens because you've added a video which could contains some frame wrong.
In order to fix this follow next steps:
1.- Identify the broken video.
In order to do this, and if you've got more than one video added, try to do an export of your edited video to MP4 file. Obviously it will fail, but until it fails, FCPX will create part of the file. Usually an MP4 can be played, even if it was not completely closed until the end. This will help you to know exactly when it stops.
You can be sure the next second, in your FCPX timeline has this issue.
2.- Fix the error.
Simply trim the video a bit to skip that frame.
3.- Export it again.
Best regards.