This behavior started happening only recently. FCPX used to provide a more accurate message of the complete progress. Writing (up to 50%) then sharing-uploading to YouTube.
Even though it seems to "hang" at 50%, it is actually still uploading (in my experience.)
It will be at "50%" while sharing and willl suddenly show upload complete.
But, exporting a file first has an advantage--YouTube recently supported upload resume. As long as the file is same name etc. You can upload the file again in the web browser (it will think a bit and compare) and it will continue the previous upload. Useful if for some reason the upload got aborted. (Or you already spent an hour uploading ..)